public function addTwigFunction($name, callable $function, array $options = [])
    {
        $twigfunction = new \Twig_SimpleFunction($name, $function, $options);

        $this->twig->addFunction($twigfunction);
    }
public function addTwigFunction($name, callable $function, array $options = [])
    {
        $twigfunction = new \Twig_SimpleFunction($name, $function, $options);

        $this->twig->addFunction($twigfunction);
    }
public function addTwigFunction ( $ name , callable $ function , array $ options = [ ] ) { $ twigfunction = new \ Twig_SimpleFunction ( $ name , $ function , $ options ) ; $ this -> twig -> addFunction ( $ twigfunction ) ; }
Adds a new Twig function.

@see http://twig.sensiolabs.org/doc/advanced.html#functions Twig documentation

@param string   $name     Name of filter
@param callable $function Filter implementation
@param array    $options
Adds a new Twig function .