public function Twig_Loader_Array::__construct

Constructor.

Parameters

array $templates An array of templates (keys are the names, and values are the source code):

See also

Twig_Loader

File

drupal/core/vendor/twig/twig/lib/Twig/Loader/Array.php, line 33

Class

Twig_Loader_Array
Loads a template from an array.

Code

public function __construct(array $templates) {
  $this->templates = array();
  foreach ($templates as $name => $template) {
    $this->templates[$name] = $template;
  }
}