diff options
| author | Michael Foster <savetheinternet@tinyboard.org> | 2013-08-01 15:20:12 -0400 |
|---|---|---|
| committer | Michael Foster <savetheinternet@tinyboard.org> | 2013-08-01 15:20:12 -0400 |
| commit | 0fe552857468aa12097a74e08f51f5aaa983be07 (patch) | |
| tree | 22dbca1be90d7086b20a077752552296abf23325 /inc/lib/Twig/Function.php | |
| parent | 22f3a95e0e421de05a11633eac846df96a2a4768 (diff) | |
Upgrade Twig library
Diffstat (limited to 'inc/lib/Twig/Function.php')
| -rw-r--r-- | inc/lib/Twig/Function.php | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/inc/lib/Twig/Function.php b/inc/lib/Twig/Function.php index 1197924a..b5ffb2b0 100644 --- a/inc/lib/Twig/Function.php +++ b/inc/lib/Twig/Function.php @@ -12,21 +12,35 @@ /** * Represents a template function. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * Use Twig_SimpleFunction instead. + * + * @author Fabien Potencier <fabien@symfony.com> + * @deprecated since 1.12 (to be removed in 2.0) */ -abstract class Twig_Function implements Twig_FunctionInterface +abstract class Twig_Function implements Twig_FunctionInterface, Twig_FunctionCallableInterface { protected $options; + protected $arguments = array(); public function __construct(array $options = array()) { $this->options = array_merge(array( 'needs_environment' => false, 'needs_context' => false, + 'callable' => null, ), $options); } + public function setArguments($arguments) + { + $this->arguments = $arguments; + } + + public function getArguments() + { + return $this->arguments; + } + public function needsEnvironment() { return $this->options['needs_environment']; @@ -49,4 +63,9 @@ abstract class Twig_Function implements Twig_FunctionInterface return array(); } + + public function getCallable() + { + return $this->options['callable']; + } } |
