|
| __construct (array $templates) |
| Constructor. More...
|
|
| setTemplate ($name, $template) |
| Adds or overrides a template. More...
|
|
| getSource ($name) |
| {Gets the source code of a template, given its name.- Parameters
-
string | $name | The name of the template to load |
- Returns
- string The template source code
- Exceptions
-
} More...
|
|
| exists ($name) |
| {Check if we have the source code of a template, given its name.- Parameters
-
string | $name | The name of the template to check if we can load |
- Returns
- boolean If the template source code is handled by this loader or not
} More...
|
|
| getCacheKey ($name) |
| {Gets the cache key to use for the cache for a given template name.- Parameters
-
string | $name | The name of the template to load |
- Returns
- string The cache key
- Exceptions
-
} More...
|
|
| isFresh ($name, $time) |
| {Returns true if the template is still fresh.- Parameters
-
string | $name | The template name |
timestamp | $time | The last modification time of the cached template |
- Returns
- Boolean true if the template is fresh, false otherwise
- Exceptions
-
} More...
|
|
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.
- Author
- Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com
Definition at line 22 of file Array.php.