public function Twig_Environment::getFunctions

Gets registered functions.

Be warned that this method cannot return functions defined with registerUndefinedFunctionCallback.

Return value

Twig_FunctionInterface[] An array of Twig_FunctionInterface instances

See also

registerUndefinedFunctionCallback

1 call to Twig_Environment::getFunctions()
Twig_Environment::getFunction in drupal/core/vendor/twig/twig/lib/Twig/Environment.php
Get a function by name.

File

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

Class

Twig_Environment
Stores the Twig configuration.

Code

public function getFunctions() {
  if (null === $this->functions) {
    foreach ($this
      ->getExtensions() as $extension) {
      foreach ($extension
        ->getFunctions() as $name => $function) {
        $this
          ->addFunction($name, $function);
      }
    }
    $this->functions = $this->staging['functions'];
  }
  return $this->functions;
}