ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
Loads a template from an array. More...
Public Member Functions | |
__construct (array $templates=array()) | |
setTemplate ($name, $template) | |
Adds or overrides a template. More... | |
getSource ($name) | |
Gets the source code of a template, given its name. More... | |
getSourceContext ($name) | |
Returns the source context for a given template logical name. More... | |
exists ($name) | |
Check if we have the source code of a template, given its name. More... | |
getCacheKey ($name) | |
Gets the cache key to use for the cache for a given template name. More... | |
isFresh ($name, $time) | |
Returns true if the template is still fresh. More... | |
Protected Attributes | |
$templates = array() | |
Loads a template from an array.
When using this loader with a cache mechanism, you should know that a new cache key is generated each time a template content "changes" (the cache key being the source code of the template). If you don't want to see your cache grows out of control, you need to take care of clearing the old cache file by yourself.
This loader should only be used for unit testing.
array | $templates | An array of templates (keys are the names, and values are the source code) |
Definition at line 33 of file Array.php.
References $templates.
Twig_Loader_Array::exists | ( | $name | ) |
Check if we have the source code of a template, given its name.
string | $name | The name of the template to check if we can load |
Implements Twig_ExistsLoaderInterface.
Definition at line 71 of file Array.php.
References $name.
Twig_Loader_Array::getCacheKey | ( | $name | ) |
Gets the cache key to use for the cache for a given template name.
string | $name | The name of the template to load |
Twig_Error_Loader | When $name is not found |
Implements Twig_LoaderInterface.
Definition at line 76 of file Array.php.
Twig_Loader_Array::getSource | ( | $name | ) |
Gets the source code of a template, given its name.
string | $name | The name of the template to load |
Twig_Error_Loader | When $name is not found |
Implements Twig_LoaderInterface.
Definition at line 49 of file Array.php.
Twig_Loader_Array::getSourceContext | ( | $name | ) |
Returns the source context for a given template logical name.
string | $name | The template logical name |
Twig_Error_Loader | When $name is not found |
Implements Twig_SourceContextLoaderInterface.
Definition at line 61 of file Array.php.
Twig_Loader_Array::isFresh | ( | $name, | |
$time | |||
) |
Returns true if the template is still fresh.
string | $name | The template name |
int | $time | Timestamp of the last modification time of the cached template |
Twig_Error_Loader | When $name is not found |
Implements Twig_LoaderInterface.
Definition at line 86 of file Array.php.
Twig_Loader_Array::setTemplate | ( | $name, | |
$template | |||
) |
|
protected |
Definition at line 28 of file Array.php.
Referenced by __construct().