public function Twig_Environment::addFunction

Registers a Function.

Parameters

string $name The function name:

Twig_FunctionInterface $function A Twig_FunctionInterface instance:

1 call to Twig_Environment::addFunction()

File

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

Class

Twig_Environment
Stores the Twig configuration.

Code

public function addFunction($name, Twig_FunctionInterface $function) {
  $this->staging['functions'][$name] = $function;
  $this->functions = null;
}