Exemple #1
0
 public function __construct(Twig_ExtensionInterface $extension, $method, array $options = array())
 {
     $options['callable'] = array($extension, $method);
     parent::__construct($options);
     $this->extension = $extension;
     $this->method = $method;
 }
Exemple #2
0
 public function __construct($class, array $options = array())
 {
     parent::__construct($options);
     $this->class = $class;
 }
Exemple #3
0
 public function addFunction(Twig_Function $function)
 {
     $this->functions[$function->getName()] = $function;
 }
Exemple #4
0
 /**
  * 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);
 }
Exemple #5
0
 public function __construct($function, array $options = array())
 {
     $options['callable'] = $function;
     parent::__construct($options);
     $this->function = $function;
 }
Exemple #6
0
    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);
 }