PHP 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 {@link 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 {@link getTemplateByFileName}.
By default, TTemplateManager is registered with {@link TPageService} as the
template manager module that can be accessed via {@link TPageService::getTemplateManager()}.
显示文件
Open project: pradosoft/prado
Public Methods
Method |
Description |
|
getTemplateByClassName ( $className ) : Prado\Web\UI\ITemplate |
Loads the template corresponding to the specified class name. |
|
getTemplateByFileName ( $fileName ) : Prado\Web\UI\ITemplate |
Loads the template from the specified file. |
|
init ( $config ) |
Initializes the module. |
|
Protected Methods
Method Details
getLocalizedTemplate()
protected method
Finds a localized template file.
getTemplateByClassName()
public method
Loads the template corresponding to the specified class name.
public getTemplateByClassName ( $className ) : Prado\Web\UI\ITemplate |
return |
Prado\Web\UI\ITemplate |
template for the class name, null if template doesn't exist. |
getTemplateByFileName()
public method
Loads the template from the specified file.
public getTemplateByFileName ( $fileName ) : Prado\Web\UI\ITemplate |
return |
Prado\Web\UI\ITemplate |
template parsed from the specified file, null if the file doesn't exist. |
This method is required by IModule and is invoked by application.
It starts output buffer if it is enabled.