Template: ezcTemplateConfiguration
[ ]
[ EBNF ] [ Functions ] [ Syntax ]
[ ]
[ ]
[ ]
[ ]
Class: ezcTemplateConfiguration
|
Contains the common configuration options for template managers. [
source]
Whenever a template source or compiled code is accessed it will use the $templatePath and $compilePath respectively as the base path. The full path is generated by using the value of theses variables and then appending a slash (/) and the subpath, this means it is possible to have the templates in the root of the filesystem by setting an empty string or a string starting with a slash. The next example demonstrates how the templatePath and compilePath can be set:
1. // accessing templates in /usr/share and compile them in /var/cache
2. $conf->templatePath = "/usr/share/eztemplate";
3. $conf->compilePath = "/var/cache/eztemplate";
Accessing templates from the applications directory is done with a single dot (.), these are also the default values.
1. // uses current directory for accessing templates and compiling them
2. $conf->templatePath = ".";
3. $conf->compilePath = ".";
The $context property is by default assigned to an ezcTemplateXhtmlContext object.
Method Summary
|
public ezcTemplateConfiguration |
__construct(
[$templatePath = "."], [$compilePath = "."], [$context = null] )
Initialises the configuration with default template, compiled path, and context. |
|
public static ezcTemplateConfiguration |
getInstance(
[$name = "default"] )
Returns the unique configuration instance named $name. |
|
public mixed |
__get(
$name )
Returns the value of the property $name. |
|
public bool |
__isset(
$name )
Returns true if the property $name is set, otherwise false. |
|
public mixed |
__set(
$name, $value )
Sets the property $name to the value $value |
Methods
__construct
ezcTemplateConfiguration __construct(
[
$templatePath = "."], [
$compilePath = "."], [
$context = null] )
Initialises the configuration with default template, compiled path, and context.
All requested templates are search from the defined $templatePath. Use an empty string to fetch templates from the root of the filesystem.
All compiled templates are placed in subfulders under the compiled templates. Use an empty string to compile templates at the root of the filesystem.
Parameters
| Name |
Type |
Description |
$templatePath |
|
|
$compilePath |
|
|
$context |
|
|
getInstance
Returns the unique configuration instance named $name.
Parameters
| Name |
Type |
Description |
$name |
|
|
__get
mixed __get(
$name )
Returns the value of the property $name.
The properties that can be retrieved are:
- ezcTemplateOutputCollection context : Contains the template context.
- string templatePath : Base path where the source templates are stored.
- string compilePath : Base path where the compiled templates are stored.
- bool checkModifiedTemplates : Set to true, to recompile outdated compiled templates.
Parameters
| Name |
Type |
Description |
$name |
|
|
Throws
| Class | Description |
ezcBasePropertyNotFoundException |
if the property does not exist. |
__isset
bool __isset(
$name )
Returns true if the property $name is set, otherwise false.
Parameters
| Name |
Type |
Description |
$name |
|
|
__set
mixed __set(
$name,
$value )
Sets the property $name to the value $value
The properties that can be set are:
- ezcTemplateOutputCollection context : Contains the template context.
- string templatePath : Base path where the source templates are stored.
- string compilePath : Base path where the compiled templates are stored.
- bool checkModifiedTemplates : Set to true, to recompile outdated compiled templates.
Parameters
| Name |
Type |
Description |
$name |
|
|
$value |
|
|
Throws
| Class | Description |
ezcBasePropertyNotFoundException |
if the property does not exist. |
Last updated: Thu, 01 Nov 2007