1 |
1686
|
darkviper
|
<?php
|
2 |
|
|
|
3 |
|
|
/*
|
4 |
|
|
* This file is part of Twig.
|
5 |
|
|
*
|
6 |
|
|
* (c) 2009 Fabien Potencier
|
7 |
|
|
*
|
8 |
|
|
* For the full copyright and license information, please view the LICENSE
|
9 |
|
|
* file that was distributed with this source code.
|
10 |
|
|
*/
|
11 |
|
|
|
12 |
|
|
/**
|
13 |
|
|
* Interface implemented by extension classes.
|
14 |
|
|
*
|
15 |
|
|
* @package twig
|
16 |
|
|
* @author Fabien Potencier <fabien@symfony.com>
|
17 |
|
|
*/
|
18 |
|
|
interface Twig_ExtensionInterface
|
19 |
|
|
{
|
20 |
|
|
/**
|
21 |
|
|
* Initializes the runtime environment.
|
22 |
|
|
*
|
23 |
|
|
* This is where you can load some file that contains filter functions for instance.
|
24 |
|
|
*
|
25 |
|
|
* @param Twig_Environment $environment The current Twig_Environment instance
|
26 |
|
|
*/
|
27 |
1852
|
darkviper
|
public function initRuntime(Twig_Environment $environment);
|
28 |
1686
|
darkviper
|
|
29 |
|
|
/**
|
30 |
|
|
* Returns the token parser instances to add to the existing list.
|
31 |
|
|
*
|
32 |
|
|
* @return array An array of Twig_TokenParserInterface or Twig_TokenParserBrokerInterface instances
|
33 |
|
|
*/
|
34 |
1852
|
darkviper
|
public function getTokenParsers();
|
35 |
1686
|
darkviper
|
|
36 |
|
|
/**
|
37 |
|
|
* Returns the node visitor instances to add to the existing list.
|
38 |
|
|
*
|
39 |
|
|
* @return array An array of Twig_NodeVisitorInterface instances
|
40 |
|
|
*/
|
41 |
1852
|
darkviper
|
public function getNodeVisitors();
|
42 |
1686
|
darkviper
|
|
43 |
|
|
/**
|
44 |
|
|
* Returns a list of filters to add to the existing list.
|
45 |
|
|
*
|
46 |
|
|
* @return array An array of filters
|
47 |
|
|
*/
|
48 |
1852
|
darkviper
|
public function getFilters();
|
49 |
1686
|
darkviper
|
|
50 |
|
|
/**
|
51 |
|
|
* Returns a list of tests to add to the existing list.
|
52 |
|
|
*
|
53 |
|
|
* @return array An array of tests
|
54 |
|
|
*/
|
55 |
1852
|
darkviper
|
public function getTests();
|
56 |
1686
|
darkviper
|
|
57 |
|
|
/**
|
58 |
|
|
* Returns a list of functions to add to the existing list.
|
59 |
|
|
*
|
60 |
|
|
* @return array An array of functions
|
61 |
|
|
*/
|
62 |
1852
|
darkviper
|
public function getFunctions();
|
63 |
1686
|
darkviper
|
|
64 |
|
|
/**
|
65 |
|
|
* Returns a list of operators to add to the existing list.
|
66 |
|
|
*
|
67 |
|
|
* @return array An array of operators
|
68 |
|
|
*/
|
69 |
1852
|
darkviper
|
public function getOperators();
|
70 |
1686
|
darkviper
|
|
71 |
|
|
/**
|
72 |
|
|
* Returns a list of global variables to add to the existing list.
|
73 |
|
|
*
|
74 |
|
|
* @return array An array of global variables
|
75 |
|
|
*/
|
76 |
1852
|
darkviper
|
public function getGlobals();
|
77 |
1686
|
darkviper
|
|
78 |
|
|
/**
|
79 |
|
|
* Returns the name of the extension.
|
80 |
|
|
*
|
81 |
|
|
* @return string The extension name
|
82 |
|
|
*/
|
83 |
1852
|
darkviper
|
public function getName();
|
84 |
1686
|
darkviper
|
}
|