|
eZ Publish
[trunk]
|
Handles filesystem retrieval of templates. More...
Inheritance diagram for eZTemplateFileResource:Public Member Functions | |
| cachedTemplateTree ($keyData, $uri, $res, $templatePath, &$extraParameters, $timestamp) | |
| cacheKey ($keyData, $res, $templatePath, &$extraParameters) | |
| canCompileTemplate ($tpl, &$resourceData, &$extraParameters) | |
| compileTemplate ($tpl, $keyData, $uri, $res, $templatePath, &$extraParameters, &$resourceData) | |
| executeCompiledTemplate ($tpl, &$textElements, $keyData, $uri, $resourceData, $templatePath, &$extraParameters, $timestamp, $rootNamespace, $currentNamespace) | |
| eZTemplateFileResource ($name="file", $servesStaticData=true) | |
| handleResource ($tpl, &$resourceData, $method, &$extraParameters) | |
| hasCachedProcessTree ($keyData, $uri, $res, $templatePath, &$extraParameters, $timestamp) | |
| hasCompiledTemplate ($keyData, $uri, &$resourceData, $templatePath, &$extraParameters, $timestamp) | |
| resourceName () | |
| servesStaticData () | |
| setCachedTemplateTree ($keyData, $uri, $res, $templatePath, &$extraParameters, &$root) | |
| templateNodeTransformation ($functionName, &$node, $tpl, &$resourceData, $parameters, $namespaceValue) | |
Static Public Member Functions | |
| handleResourceData ($tpl, $handler, &$resourceData, $method, &$extraParameters) | |
Public Attributes | |
| $Name | |
| The name of the resource. | |
| $ServesStaticData | |
| True if the data served from this resource is static, ie it can be cached properly. | |
| $TemplateCache | |
| The cache for templates. | |
Handles filesystem retrieval of templates.
Templates are loaded from the disk and returned to the template system. The name of the resource is "file:".
Definition at line 19 of file eztemplatefileresource.php.
| eZTemplateFileResource::cachedTemplateTree | ( | $ | keyData, |
| $ | uri, | ||
| $ | res, | ||
| $ | templatePath, | ||
| &$ | extraParameters, | ||
| $ | timestamp | ||
| ) |
Definition at line 137 of file eztemplatefileresource.php.
| eZTemplateFileResource::cacheKey | ( | $ | keyData, |
| $ | res, | ||
| $ | templatePath, | ||
| &$ | extraParameters | ||
| ) |
Generates a unique key string from the input data and returns it. The key will be used for storing cached data and retrieving cache files. When implementing file resource handlers this key must be reimplemented if the current code does not generate correct keys. However most file based resource handlers can simple reuse this class.
Default implementation returns an md5 of the $keyData.
Definition at line 77 of file eztemplatefileresource.php.
Referenced by cachedTemplateTree(), compileTemplate(), executeCompiledTemplate(), hasCachedProcessTree(), hasCompiledTemplate(), and setCachedTemplateTree().
| eZTemplateFileResource::canCompileTemplate | ( | $ | tpl, |
| &$ | resourceData, | ||
| &$ | extraParameters | ||
| ) |
true if a compiled template can be generated for this request. Definition at line 129 of file eztemplatefileresource.php.
| eZTemplateFileResource::compileTemplate | ( | $ | tpl, |
| $ | keyData, | ||
| $ | uri, | ||
| $ | res, | ||
| $ | templatePath, | ||
| &$ | extraParameters, | ||
| &$ | resourceData | ||
| ) |
Sets the cached node tree for the selected template to $root.
Definition at line 98 of file eztemplatefileresource.php.
| eZTemplateFileResource::executeCompiledTemplate | ( | $ | tpl, |
| &$ | textElements, | ||
| $ | keyData, | ||
| $ | uri, | ||
| $ | resourceData, | ||
| $ | templatePath, | ||
| &$ | extraParameters, | ||
| $ | timestamp, | ||
| $ | rootNamespace, | ||
| $ | currentNamespace | ||
| ) |
Sets the cached node tree for the selected template to $root.
Definition at line 107 of file eztemplatefileresource.php.
| eZTemplateFileResource::eZTemplateFileResource | ( | $ | name = "file", |
| $ | servesStaticData = true |
||
| ) |
Initializes with a default resource name "file". Also sets whether the resource servers static data files, this is needed for the cache system.
Definition at line 26 of file eztemplatefileresource.php.
Referenced by eZTemplateDesignResource\eZTemplateDesignResource().
| eZTemplateFileResource::handleResource | ( | $ | tpl, |
| &$ | resourceData, | ||
| $ | method, | ||
| &$ | extraParameters | ||
| ) |
Loads the template file if it exists, also sets the modification timestamp. Returns true if the file exists.
Reimplemented in eZTemplateDesignResource.
Definition at line 159 of file eztemplatefileresource.php.
| eZTemplateFileResource::handleResourceData | ( | $ | tpl, |
| $ | handler, | ||
| &$ | resourceData, | ||
| $ | method, | ||
| &$ | extraParameters | ||
| ) | [static] |
Reusable function for handling file based loading. Call this with the resource handler object in $handler. It will load the template file and handle any charsets conversion if necessary. It will also handle tree node caching if one is found.
Definition at line 171 of file eztemplatefileresource.php.
Referenced by handleResource(), and eZTemplateDesignResource\handleResource().
| eZTemplateFileResource::hasCachedProcessTree | ( | $ | keyData, |
| $ | uri, | ||
| $ | res, | ||
| $ | templatePath, | ||
| &$ | extraParameters, | ||
| $ | timestamp | ||
| ) |
Definition at line 86 of file eztemplatefileresource.php.
| eZTemplateFileResource::hasCompiledTemplate | ( | $ | keyData, |
| $ | uri, | ||
| &$ | resourceData, | ||
| $ | templatePath, | ||
| &$ | extraParameters, | ||
| $ | timestamp | ||
| ) |
true if a compiled template exists for the current request. Definition at line 120 of file eztemplatefileresource.php.
Returns the name of the resource.
Definition at line 36 of file eztemplatefileresource.php.
Definition at line 45 of file eztemplatefileresource.php.
| eZTemplateFileResource::setCachedTemplateTree | ( | $ | keyData, |
| $ | uri, | ||
| $ | res, | ||
| $ | templatePath, | ||
| &$ | extraParameters, | ||
| &$ | root | ||
| ) |
Sets the cached node tree for the selected template to $root.
Definition at line 148 of file eztemplatefileresource.php.
| eZTemplateFileResource::templateNodeTransformation | ( | $ | functionName, |
| &$ | node, | ||
| $ | tpl, | ||
| &$ | resourceData, | ||
| $ | parameters, | ||
| $ | namespaceValue | ||
| ) |
Reimplemented in eZTemplateDesignResource.
Definition at line 50 of file eztemplatefileresource.php.
| eZTemplateFileResource::$Name |
The name of the resource.
Definition at line 285 of file eztemplatefileresource.php.
| eZTemplateFileResource::$ServesStaticData |
True if the data served from this resource is static, ie it can be cached properly.
Definition at line 287 of file eztemplatefileresource.php.
| eZTemplateFileResource::$TemplateCache |
The cache for templates.
Definition at line 289 of file eztemplatefileresource.php.