[ Index ] |
|
Code source de PRADO 3.0.6 |
[Code source] [Imprimer] [Statistiques]
TTemplateManager and TTemplate class file
Author: | Qiang Xue <qiang.xue@gmail.com> |
Copyright: | Copyright © 2005 PradoSoft |
License: | http://www.pradosoft.com/license/ |
Version: | $Id: TTemplateManager.php 1536 2006-12-01 19:51:21Z xue $ |
Poids: | 1000 lignes (34 kb) |
Inclus ou requis: | 0 fois |
Référencé: | 0 fois |
Nécessite: | 0 fichiers |
TTemplateManager:: (4 méthodes):
init()
getTemplateByClassName()
getTemplateByFileName()
getLocalizedTemplate()
TTemplate:: (19 méthodes):
__construct()
getIsSourceTemplate()
getContextPath()
getDirective()
getItems()
instantiateIn()
configureControl()
configureComponent()
configureEvent()
configureProperty()
configureSubProperty()
parse()
parseAttributes()
parseTemplateProperty()
parseAttribute()
validateAttributes()
getIncludedFiles()
handleException()
preprocess()
Classe: TTemplateManager - X-Ref
TTemplateManager classinit($config) X-Ref |
Initializes the module. This method is required by IModule and is invoked by application. It starts output buffer if it is enabled. param: TXmlElement module configuration |
getTemplateByClassName($className) X-Ref |
Loads the template corresponding to the specified class name. return: ITemplate template for the class name, null if template doesn't exist. |
getTemplateByFileName($fileName) X-Ref |
Loads the template from the specified file. return: ITemplate template parsed from the specified file, null if the file doesn't exist. |
getLocalizedTemplate($filename) X-Ref |
Finds a localized template file. param: string template file. return: string|null a localized template file if found, null otherwise. |
__construct($template,$contextPath,$tplFile=null,$startingLine=0,$sourceTemplate=true) X-Ref |
Constructor. The template will be parsed after construction. param: string the template string param: string the template context directory param: string the template file, null if no file param: integer the line number that parsing starts from (internal use) param: boolean whether this template is a source template, i.e., this template is loaded from |
getIsSourceTemplate() X-Ref |
return: boolean whether this template is a source template, i.e., this template is loaded from |
getContextPath() X-Ref |
return: string context directory path |
getDirective() X-Ref |
return: array name-value pairs declared in the directive |
getItems() X-Ref |
return: array the parsed template |
instantiateIn($tplControl) X-Ref |
Instantiates the template. Content in the template will be instantiated as components and text strings and passed to the specified parent control. param: TControl the parent control |
configureControl($control,$name,$value) X-Ref |
Configures a property/event of a control. param: TControl control to be configured param: string property name param: mixed property initial value |
configureComponent($component,$name,$value) X-Ref |
Configures a property of a non-control component. param: TComponent component to be configured param: string property name param: mixed property initial value |
configureEvent($control,$name,$value,$contextControl) X-Ref |
Configures an event for a control. param: TControl control to be configured param: string event name param: string event handler param: TControl context control |
configureProperty($component,$name,$value) X-Ref |
Configures a simple property for a component. param: TComponent component to be configured param: string property name param: mixed property initial value |
configureSubProperty($component,$name,$value) X-Ref |
Configures a subproperty for a component. param: TComponent component to be configured param: string subproperty name param: mixed subproperty initial value |
parse($input) X-Ref |
Parses a template string. This template parser recognizes five types of data: regular string, well-formed component tags, well-formed property tags, directives, and expressions. The parsing result is returned as an array. Each array element can be of three types: - a string, 0: container index; 1: string content; - a component tag, 0: container index; 1: component type; 2: attributes (name=>value pairs) If a directive is found in the template, it will be parsed and can be retrieved via {@link getDirective}, which returns an array consisting of name-value pairs in the directive. Note, attribute names are treated as case-insensitive and will be turned into lower cases. Component and directive types are case-sensitive. Container index is the index to the array element that stores the container object. If an object has no container, its container index is -1. param: string the template string |
parseAttributes($str,$offset) X-Ref |
Parses the attributes of a tag from a string. param: string the string to be parsed. return: array attribute values indexed by names. |
parseTemplateProperty($content,$offset) X-Ref |
Pas de description |
parseAttribute($value) X-Ref |
Parses a single attribute. param: string the string to be parsed. return: array attribute initialization |
validateAttributes($type,$attributes) X-Ref |
Pas de description |
getIncludedFiles() X-Ref |
return: array list of included external template files |
handleException($e,$line,$input=null) X-Ref |
Handles template parsing exception. This method rethrows the exception caught during template parsing. It adjusts the error location by giving out correct error line number and source file. param: Exception template exception param: int line number param: string template string if no source file is used |
preprocess($input) X-Ref |
Preprocesses the template string by including external templates param: string template string return: string expanded template string |
Généré le : Sun Feb 25 21:07:04 2007 | par Balluche grâce à PHPXref 0.7 |