public function Twig_Environment::getExtension

Gets an extension by name.

Parameters

string $name The extension name:

Return value

Twig_ExtensionInterface A Twig_ExtensionInterface instance

File

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

Class

Twig_Environment
Stores the Twig configuration.

Code

public function getExtension($name) {
  if (!isset($this->extensions[$name])) {
    throw new Twig_Error_Runtime(sprintf('The "%s" extension is not enabled.', $name));
  }
  return $this->extensions[$name];
}