Loads a template from a string.
This loader should NEVER be used. It only exists for Twig internal purposes.
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.
deprecated | since 1.18.1 (to be removed in 2.0) |
---|---|
internal | |
author | Fabien Potencier fabien@symfony.com |
package | Default |
exists(string $name): boolean
string
The name of the template to check if we can load
boolean
If the template source code is handled by this loader or not
getCacheKey(string $name): string
string
The name of the template to load
string
The cache key
getSource(string $name): string
string
The name of the template to load
string
The template source code
getSourceContext(string $name): \Twig\Source
isFresh(string $name,integer $time): boolean
string
The template name
integer
Timestamp of the last modification time of the cached template
boolean
true if the template is fresh, false otherwise