Class \Prado\Web\UI\TTemplateManager
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 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 getTemplateByFileName.
By default, TTemplateManager is registered with TPageService as the template manager module that can be accessed via TPageService::getTemplateManager().
Class hierarchy
- \Prado\Web\UI\TTemplateManager
- \Prado\TModule implements IModule
- \Prado\TApplicationComponent
- \Prado\TComponent
Since: 3.0
public
|
|
public
|
getTemplateByClassName(mixed $className) : TTemplate
Loads the template corresponding to the specified class name.
|
public
|
getTemplateByFileName(string $fileName[, mixed $tplClass = null ][, string $culture = null ]) : TTemplate
Loads the template from the specified file.
|
public
|
init(TXmlElement $config) : mixed
Initializes the module.
This method is required by IModule and is invoked by application. It starts output buffer if it is enabled. |
public
|
|
protected
|
getLocalizedTemplate(string $filename[, string $culture = null ]) : null|string
Finds a localized template file.
|
public
mixed
|
TEMPLATE_CACHE_PREFIX
Prefix of the cache variable name for storing parsed templates
|
'prado:template:'
|
public
mixed
|
TEMPLATE_FILE_EXT
Template file extension
|
'.tpl'
|
\Prado\TApplicationComponent::FX_CACHE_FILE, \Prado\TComponent::GLOBAL_RAISE_EVENT_LISTENER |