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 addFilter(Twig_Filter $filter) { $this->filters[$filter->getName()] = $filter; }
/** * Registers a Filter. * * @param Twig_Filter $filter A Twig_Filter instance */ public function addFilter(Twig_Filter $filter) { if ($this->extensionInitialized) { throw new LogicException(sprintf('Unable to add filter "%s" as extensions have already been initialized.', $filter->getName())); } $this->staging->addFilter($filter); }
public function __construct($function, array $options = array()) { $options['callable'] = $function; parent::__construct($options); $this->function = $function; }
public function __construct($class, array $options = array()) { parent::__construct($options); $this->class = $class; }
public function __construct($type, array $options = array()) { parent::__construct($options); $this->type = $type; }
public function __construct($function, array $options = array()) { parent::__construct($options); $this->function = $function; }