public function Twig_Environment::addExtension

Registers an extension.

Parameters

Twig_ExtensionInterface $extension A Twig_ExtensionInterface instance:

1 call to Twig_Environment::addExtension()
Twig_Environment::setExtensions in drupal/core/vendor/twig/twig/lib/Twig/Environment.php
Registers an array of extensions.

File

drupal/core/vendor/twig/twig/lib/Twig/Environment.php, line 630

Class

Twig_Environment
Stores the Twig configuration.

Code

public function addExtension(Twig_ExtensionInterface $extension) {
  $this->extensions[$extension
    ->getName()] = $extension;
  $this->parsers = null;
  $this->visitors = null;
  $this->filters = null;
  $this->tests = null;
  $this->functions = null;
  $this->globals = null;
}