Class TTemplateManager
TTemplateManager class
TTemplateManager manages the loading and parsing of control templates.
There are two ways of loading a template, either by the associated template
control class name, or the template file name. The former is via calling TTemplateManager::getTemplateByClassName()
, which tries to locate the corresponding template file
under the directory containing the class file. The name of the template file is
the class name with the extension '.tpl'. To load a template from a template
file path, call TTemplateManager::getTemplateByFileName()
.
By default, TTemplateManager is registered with TPageService
as the
template manager module that can be accessed via TPageService::getTemplateManager()
.
- TComponent
-
TApplicationComponent
-
TModule implements IModule
-
TTemplateManager
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 3.0
Located at Web/UI/TTemplateManager.php
public
|
#
init(
Initializes the module. This method is required by IModule and is invoked by application. It starts output buffer if it is enabled. |
public
|
#
getTemplateByClassName( mixed $className )
Loads the template corresponding to the specified class name. |
public
|
|
protected
string|null
|
getID(),
setID()
|
getApplication(),
getRequest(),
getResponse(),
getService(),
getSession(),
getUser(),
publishAsset(),
publishFilePath()
|
string |
TEMPLATE_FILE_EXT |
'.tpl' |
#
Template file extension |
string |
TEMPLATE_CACHE_PREFIX |
'prado:template:' |
#
Prefix of the cache variable name for storing parsed templates |
GLOBAL_RAISE_EVENT_LISTENER
|