class TwigEnvironment

A class that defines a Twig environment for Drupal.

Instances of this class are used to store the configuration and extensions, and are used to load templates from the file system or other locations.

Hierarchy

  • class \Drupal\Core\Template\TwigEnvironment extends \Drupal\Core\Template\Twig_Environment

Expanded class hierarchy of TwigEnvironment

See also

core\vendor\twig\twig\lib\Twig\Enviornment.php

File

drupal/core/lib/Drupal/Core/Template/TwigEnvironment.php, line 20
Definition of Drupal\Core\Template\TwigEnvironment.

Namespace

Drupal\Core\Template
View source

Members

Namesort descending Modifiers Type Description Overrides
TwigEnvironment::$cache_object protected property
TwigEnvironment::$storage protected property
TwigEnvironment::$templateClasses protected property Static cache of template classes.
TwigEnvironment::getTemplateClass public function
TwigEnvironment::loadTemplate public function Implements Twig_Environment::loadTemplate().
TwigEnvironment::needsUpdate public function Checks if the compiled template needs an update.
TwigEnvironment::storage protected function Gets the PHP code storage object to use for the compiled Twig files.
TwigEnvironment::updateCompiledTemplate public function Compile the source and write the compiled template to disk.
TwigEnvironment::__construct public function Constructs a TwigEnvironment object and stores cache and storage internally.