51 @trigger_error(
sprintf(
'Calling "getSource" on "%s" is deprecated since 1.27. Use getSourceContext() instead.', get_class($this)), E_USER_DEPRECATED);
54 if (!isset($this->templates[
$name])) {
58 return $this->templates[
$name];
64 if (!isset($this->templates[
$name])) {
73 return isset($this->templates[(
string)
$name]);
79 if (!isset($this->templates[
$name])) {
89 if (!isset($this->templates[
$name])) {
97class_alias(
'Twig_Loader_Array',
'Twig\Loader\ArrayLoader',
false);
sprintf('%.4f', $callTime)
An exception for terminatinating execution or to throw for unit testing.
Exception thrown when an error occurs during template loading.
Loads a template from an array.
isFresh($name, $time)
Returns true if the template is still fresh.
getSourceContext($name)
Returns the source context for a given template logical name.
setTemplate($name, $template)
Adds or overrides a template.
exists($name)
Check if we have the source code of a template, given its name.
getSource($name)
Gets the source code of a template, given its name.
__construct(array $templates=array())
getCacheKey($name)
Gets the cache key to use for the cache for a given template name.
Holds information about a non-compiled Twig template.
Adds an exists() method for loaders.
Interface all loaders must implement.
Adds a getSourceContext() method for loaders.