Public Member Functions | |
| getName () | |
| Gets the name of this template. | |
| getTemplateFile () | |
| Gets the template file. | |
| getFolder () | |
| Gets the template folder. | |
| getWidth () | |
| Gets the declared width of the template. | |
| getCacheOptions () | |
| Provides options for the caching mechanism. | |
| getDescription () | |
| Gets the description of the template out of the doc comment. | |
| getAnnotations () | |
| Provides all annotations of this template. | |
| getJsIsInHeader () | |
| Whether this template's js file should be in the header. | |
| getRequiredVariables () | |
| Gets the required variables, mapped to their type description. | |
| getVariableDefaults () | |
| Gets the current variable defaults. | |
| filterVariables ($variables) | |
| Checks for each variable given whether it is defined in the template. | |
| getRequiredCss () | |
| getRequiredJs () | |
| display ($variables) | |
| Shows this template with given variable values. | |
Static Public Member Functions | |
| static | get ($alias) |
| Gets the template with given alias. | |
| static | parseVarType ($string, $filePath) |
| Parses a variable definition line in the doc comment. | |
Protected Member Functions | |
| __construct ($name, $file) | |
| Constructor. | |
| initFromDocComment () | |
| Sets members according to definition in the template file's doc comment. | |
Protected Attributes | |
| $name | |
| The name of this template. | |
| $variables = array() | |
| Variables required by this template, mapped to their type description. | |
| $variableDefaults = array() | |
| Default values for variables. | |
| $requiredCss = array() | |
| Css aliases required by this template. | |
| $headerJs = array() | |
| Header javascript aliases required by this template. | |
| $footerJs = array() | |
| Footer javascript aliases required by this template. | |
| $width | |
| Width of the template as declared in doc comment. | |
| $description | |
| Description of the template as declared in doc comment. | |
| $annotations | |
| All annotations of this template. | |
| $file | |
| The template file. | |
| $cacheOptions = array() | |
| Mapping cache options to their values. | |
| $jsIsInHeader = false | |
| Whether this file's javascript file should be in the header. | |
| $devModeComments = true | |
| Whether surrounding html comments should be displayed in dev mode. | |
Static Protected Attributes | |
| static | $instances = array() |
Private Member Functions | |
| printComments () | |
| Checks if HTML comments should be displayed before & after tpl. | |
| _display ($variables) | |
| Helper function for display(). | |
spunQ templates are kept in separate folders (one for each template), since the number of files associated with a single folder can be quite a few. A template folder can contain the following files:
Definition at line 27 of file Template.class.php.
| spunQ_Template::__construct | ( | $ | name, | |
| $ | file | |||
| ) | [protected] |
Constructor.
| $name | The name of the template | |
| $file | The template file |
Definition at line 161 of file Template.class.php.
| spunQ_Template::_display | ( | $ | variables | ) | [private] |
Helper function for display().
Needed for including the template file with a clean scope.
| $variables | The variables to set. |
Definition at line 439 of file Template.class.php.
| spunQ_Template::display | ( | $ | variables | ) |
Shows this template with given variable values.
| $variables | Mapping of variable names to values. |
Definition at line 280 of file Template.class.php.
| spunQ_Template::filterVariables | ( | $ | variables | ) |
Checks for each variable given whether it is defined in the template.
| $variables | Mapping of variable names to values. |
Definition at line 255 of file Template.class.php.
| static spunQ_Template::get | ( | $ | alias | ) | [static] |
Gets the template with given alias.
| $alias | The alias to get template for. |
Definition at line 36 of file Template.class.php.
| spunQ_Template::getAnnotations | ( | ) |
Provides all annotations of this template.
Definition at line 220 of file Template.class.php.
| spunQ_Template::getCacheOptions | ( | ) |
Provides options for the caching mechanism.
Definition at line 205 of file Template.class.php.
| spunQ_Template::getFolder | ( | ) |
| spunQ_Template::getJsIsInHeader | ( | ) |
Whether this template's js file should be in the header.
footers()
Definition at line 230 of file Template.class.php.
| spunQ_Template::getName | ( | ) |
| spunQ_Template::getRequiredVariables | ( | ) |
Gets the required variables, mapped to their type description.
Definition at line 238 of file Template.class.php.
| spunQ_Template::getTemplateFile | ( | ) |
| spunQ_Template::initFromDocComment | ( | ) | [protected] |
Sets members according to definition in the template file's doc comment.
Definition at line 339 of file Template.class.php.
| static spunQ_Template::parseVarType | ( | $ | string, | |
| $ | filePath | |||
| ) | [static] |
Parses a variable definition line in the doc comment.
| $string | The line to parse. | |
| $filePath | The path to the file this line is coming from. Solely needed for pointing at the file in the case of an exception. |
Definition at line 54 of file Template.class.php.
| spunQ_Template::printComments | ( | ) | [private] |
Checks if HTML comments should be displayed before & after tpl.
Placed in dedicated function to not clutter scope of _display().
Definition at line 425 of file Template.class.php.
spunQ_Template::$annotations [protected] |
All annotations of this template.
Definition at line 129 of file Template.class.php.
spunQ_Template::$cacheOptions = array() [protected] |
Mapping cache options to their values.
Definition at line 141 of file Template.class.php.
spunQ_Template::$description [protected] |
Description of the template as declared in doc comment.
Definition at line 123 of file Template.class.php.
spunQ_Template::$file [protected] |
spunQ_Template::$footerJs = array() [protected] |
Footer javascript aliases required by this template.
Definition at line 111 of file Template.class.php.
spunQ_Template::$headerJs = array() [protected] |
Header javascript aliases required by this template.
Definition at line 105 of file Template.class.php.
spunQ_Template::$jsIsInHeader = false [protected] |
Whether this file's javascript file should be in the header.
footers()
Definition at line 149 of file Template.class.php.
spunQ_Template::$name [protected] |
spunQ_Template::$requiredCss = array() [protected] |
Css aliases required by this template.
Definition at line 99 of file Template.class.php.
spunQ_Template::$variableDefaults = array() [protected] |
Default values for variables.
If a url template omits a variable, this default value will be assumed.
Definition at line 93 of file Template.class.php.
spunQ_Template::$variables = array() [protected] |
Variables required by this template, mapped to their type description.
Definition at line 85 of file Template.class.php.
spunQ_Template::$width [protected] |
Width of the template as declared in doc comment.
Definition at line 117 of file Template.class.php.
1.5.9