From d1384deb9b3ac872defd08fd01fbf8cf11442b45 Mon Sep 17 00:00:00 2001 From: xue <> Date: Wed, 4 Jan 2006 04:59:01 +0000 Subject: Added documentation. --- framework/Web/UI/TTemplateManager.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'framework/Web/UI/TTemplateManager.php') diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php index 0187dfd9..cb44b81d 100644 --- a/framework/Web/UI/TTemplateManager.php +++ b/framework/Web/UI/TTemplateManager.php @@ -15,9 +15,13 @@ * * TTemplateManager manages the loading and parsing of control templates. * - * Given a class name, TTemplateManager 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'. + * 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()}. @@ -115,7 +119,7 @@ class TTemplateManager extends TModule * A TTemplate object represents a parsed PRADO template. To instantiate the template * for a particular control, call {@link instantiateIn($control)}, which * will create and intialize all components specified in the template and - * set their parent as the control. + * set their parent as $control. * * @author Qiang Xue * @version $Revision: $ $Date: $ @@ -129,8 +133,8 @@ class TTemplate extends TComponent implements ITemplate * '' - HTML comments * '<\/?com:([\w\.]+)((?:\s*[\w\.]+=\'.*?\'|\s*[\w\.]+=".*?"|\s*[\w\.]+=<%.*?%>)*)\s*\/?>' - component tags * '<\/?prop:([\w\.]+)\s*>' - property tags - * '<%@\s*(\w+)((?:\s*[\w\.]+=\'.*?\'|\s*[\w\.]+=".*?")*)\s*%>' - directives - * '<%=?(.*?)%> | <%#(.*?)%>' - expressions + * '<%@\s*((?:\s*[\w\.]+=\'.*?\'|\s*[\w\.]+=".*?")*)\s*%>' - directives + * '<%[%#~\\$=](.*?)%>' - expressions */ const REGEX_RULES='/||<\/?com:([\w\.]+)((?:\s*[\w\.]+=\'.*?\'|\s*[\w\.]+=".*?"|\s*[\w\.]+=<%.*?%>)*)\s*\/?>|<\/?prop:([\w\.]+)\s*>|<%@\s*((?:\s*[\w\.]+=\'.*?\'|\s*[\w\.]+=".*?")*)\s*%>|<%[%#~\\$=](.*?)%>/msS'; -- cgit v1.2.3