You are here

public function Twig_Environment::getExtension in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/twig/twig/lib/Twig/Environment.php \Twig_Environment::getExtension()

Gets an extension by name.

Parameters

string $name The extension name:

Return value

Twig_ExtensionInterface A Twig_ExtensionInterface instance

File

vendor/twig/twig/lib/Twig/Environment.php, line 767

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];
}