class Twig_Filter_Method in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/twig/twig/lib/Twig/Filter/Method.php \Twig_Filter_Method
Represents a method template filter.
Use Twig_SimpleFilter instead.
@author Fabien Potencier <fabien@symfony.com>
Hierarchy
- class \Twig_Filter implements Twig_FilterCallableInterface, Twig_FilterInterface
- class \Twig_Filter_Method
Expanded class hierarchy of Twig_Filter_Method
Deprecated
since 1.12 (to be removed in 2.0)
File
- vendor/
twig/ twig/ lib/ Twig/ Filter/ Method.php, line 23
View source
class Twig_Filter_Method extends Twig_Filter {
protected $extension;
protected $method;
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 compile() {
return sprintf('$this->env->getExtension(\'%s\')->%s', $this->extension
->getName(), $this->method);
}
}