4 * This file is part of Twig.
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
13 * Interface implemented by extension classes.
15 * @author Fabien Potencier <fabien@symfony.com>
17 interface Twig_ExtensionInterface
20 * Initializes the runtime environment.
22 * This is where you can load some file that contains filter functions for instance.
24 * @deprecated since 1.23 (to be removed in 2.0), implement Twig_Extension_InitRuntimeInterface instead
26 public function initRuntime(Twig_Environment $environment);
29 * Returns the token parser instances to add to the existing list.
31 * @return Twig_TokenParserInterface[]
33 public function getTokenParsers();
36 * Returns the node visitor instances to add to the existing list.
38 * @return Twig_NodeVisitorInterface[]
40 public function getNodeVisitors();
43 * Returns a list of filters to add to the existing list.
45 * @return Twig_SimpleFilter[]
47 public function getFilters();
50 * Returns a list of tests to add to the existing list.
52 * @return Twig_SimpleTest[]
54 public function getTests();
57 * Returns a list of functions to add to the existing list.
59 * @return Twig_SimpleFunction[]
61 public function getFunctions();
64 * Returns a list of operators to add to the existing list.
66 * @return array<array> First array of unary operators, second array of binary operators
68 public function getOperators();
71 * Returns a list of global variables to add to the existing list.
73 * @return array An array of global variables
75 * @deprecated since 1.23 (to be removed in 2.0), implement Twig_Extension_GlobalsInterface instead
77 public function getGlobals();
80 * Returns the name of the extension.
82 * @return string The extension name
84 * @deprecated since 1.26 (to be removed in 2.0), not used anymore internally
86 public function getName();