1 | <?php |
||
21 | class Loader implements \Twig_LoaderInterface, \Twig_SourceContextLoaderInterface |
||
22 | { |
||
23 | |||
24 | /** |
||
25 | * Get the file contents of a template. |
||
26 | * |
||
27 | * @param string $name Template. |
||
28 | * |
||
29 | * @return string |
||
30 | */ |
||
31 | 4 | public function getSource($name) |
|
37 | |||
38 | /** |
||
39 | * Returns the source context for a given template logical name. |
||
40 | * |
||
41 | * @param string $name The template logical name |
||
42 | * |
||
43 | * @return Twig_Source |
||
44 | * |
||
45 | * @throws Twig_Error_Loader When $name is not found |
||
46 | */ |
||
47 | 2 | public function getSourceContext($name) |
|
54 | |||
55 | /** |
||
56 | * Get cache key for template. |
||
57 | * |
||
58 | * @param string $name Template. |
||
59 | * |
||
60 | * @return string |
||
61 | */ |
||
62 | 5 | public function getCacheKey($name) |
|
66 | |||
67 | /** |
||
68 | * Check if template is still fresh. |
||
69 | * |
||
70 | * @param string $name Template. |
||
71 | * @param integer $time Timestamp. |
||
72 | * |
||
73 | * @return boolean |
||
74 | */ |
||
75 | 2 | public function isFresh($name, $time) |
|
81 | |||
82 | /** |
||
83 | * Check if we have the source code of a template, given its name. |
||
84 | * |
||
85 | * @param string $name The name of the template to check if we can load |
||
86 | * |
||
87 | * @return bool If the template source code is handled by this loader or not |
||
88 | */ |
||
89 | // @codingStandardsIgnoreStart |
||
90 | public function exists($name) { |
||
99 | |||
100 | /** |
||
101 | * Resolve template name to filename. |
||
102 | * |
||
103 | * @param string $name Template. |
||
104 | * |
||
105 | * @return string |
||
106 | * |
||
107 | * @throws \Twig_Error_Loader Thrown when template file isn't found. |
||
108 | */ |
||
109 | // @codingStandardsIgnoreStart |
||
110 | 9 | protected function resolveFileName($name) |
|
119 | |||
120 | /** |
||
121 | * Get template filename |
||
122 | * |
||
123 | * @param string $name Template. |
||
124 | * |
||
125 | * @return string|false |
||
126 | * |
||
127 | */ |
||
128 | // @codingStandardsIgnoreStart |
||
129 | 9 | protected function getFilename($name) |
|
154 | |||
155 | /** |
||
156 | * Check if $plugin is active and return it's template paths or return the aps template paths. |
||
157 | * |
||
158 | * @param string|null $plugin The plugin in question. |
||
159 | * |
||
160 | * @return array |
||
161 | */ |
||
162 | 6 | protected function getPaths($plugin) |
|
170 | } |
||
171 |