public function __construct(Twig_ExtensionInterface $extension, $method, array $options = array()) { $options['callable'] = array($extension, $method); parent::__construct($options); $this->extension = $extension; $this->method = $method; }
public function __construct($class, array $options = array()) { parent::__construct($options); $this->class = $class; }
public function addFunction(Twig_Function $function) { $this->functions[$function->getName()] = $function; }
/** * Registers a Function. * * @param Twig_Function $function A Twig_Function instance */ public function addFunction(Twig_Function $function) { if ($this->extensionInitialized) { throw new LogicException(sprintf('Unable to add function "%s" as extensions have already been initialized.', $function->getName())); } $this->staging->addFunction($function); }
public function __construct($function, array $options = array()) { $options['callable'] = $function; parent::__construct($options); $this->function = $function; }
public function __construct($function, array $options = array()) { parent::__construct($options); $this->function = $function; }
public function __construct($filter, $options = array()) { $this->filter = $filter; parent::__construct($options); }