|
Jobbuddy
|
Fonctions membres publiques | |
| __construct (private array $templates=[],) | |
| setTemplate (string $name, string $template) | |
| getSourceContext (string $name) | |
| exists (string $name) | |
| getCacheKey (string $name) | |
| isFresh (string $name, int $time) | |
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.
| __construct | ( | private array | $templates = [] | ) |
| array | $templates | An array of templates (keys are the names, and values are the source code) |
| exists | ( | string | $name | ) |
Implémente LoaderInterface.
| getCacheKey | ( | string | $name | ) |
Gets the cache key to use for the cache for a given template name.
| LoaderError | When $name is not found |
Implémente LoaderInterface.
| getSourceContext | ( | string | $name | ) |
Returns the source context for a given template logical name.
| LoaderError | When $name is not found |
Implémente LoaderInterface.
| isFresh | ( | string | $name, |
| int | $time ) |
| int | $time | Timestamp of the last modification time of the cached template |
| LoaderError | When $name is not found |
Implémente LoaderInterface.