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])) {
68 return new Twig_Source($this->templates[$name], $name);
73 return isset($this->templates[(
string)
$name]);
79 if (!isset($this->templates[
$name])) {
83 return $name.
':'.$this->templates[
$name];
89 if (!isset($this->templates[
$name])) {
97 class_alias(
'Twig_Loader_Array',
'Twig\Loader\ArrayLoader',
false);
Exception thrown when an error occurs during template loading.
__construct(array $templates=array())
getSource($name)
Gets the source code of a template, given its name.
Adds an exists() method for loaders.
Adds a getSourceContext() method for loaders.
getSourceContext($name)
Returns the source context for a given template logical name.
getCacheKey($name)
Gets the cache key to use for the cache for a given template name.
isFresh($name, $time)
Returns true if the template is still fresh.
Holds information about a non-compiled Twig template.
setTemplate($name, $template)
Adds or overrides a template.
Interface all loaders must implement.
Loads a template from an array.
exists($name)
Check if we have the source code of a template, given its name.