4 * This file is part of Twig.
6 * (c) 2012 Fabien Potencier
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
15 * This class is used by Twig_Environment as a staging area and must not be used directly.
17 * @author Fabien Potencier <fabien@symfony.com>
19 class Twig_Extension_Staging
extends Twig_Extension
21 protected $functions = array();
22 protected $filters = array();
23 protected $visitors = array();
24 protected $tokenParsers = array();
25 protected $globals = array();
26 protected $tests = array();
28 public function addFunction($name, $function)
30 $this->functions
[$name] = $function;
36 public function getFunctions()
38 return $this->functions
;
41 public function addFilter($name, $filter)
43 $this->filters
[$name] = $filter;
49 public function getFilters()
51 return $this->filters
;
54 public function addNodeVisitor(Twig_NodeVisitorInterface
$visitor)
56 $this->visitors
[] = $visitor;
62 public function getNodeVisitors()
64 return $this->visitors
;
67 public function addTokenParser(Twig_TokenParserInterface
$parser)
69 $this->tokenParsers
[] = $parser;
75 public function getTokenParsers()
77 return $this->tokenParsers
;
80 public function addGlobal($name, $value)
82 $this->globals
[$name] = $value;
88 public function getGlobals()
90 return $this->globals
;
93 public function addTest($name, $test)
95 $this->tests
[$name] = $test;
101 public function getTests()
109 public function getName()