1 | <?php |
||
16 | class TwigLoader extends AbstractLoader implements |
||
17 | LoaderInterface, |
||
18 | Twig_LoaderInterface |
||
19 | { |
||
20 | /** |
||
21 | * Determine if the variable is a template literal. |
||
22 | * |
||
23 | * This method looks for any tag delimiters in the given string, |
||
24 | * which a file path would most likely not have. |
||
25 | * |
||
26 | * @todo Add support for custom delimiters. |
||
27 | * @param string $ident The template being evaluated. |
||
28 | * @return boolean |
||
29 | */ |
||
30 | protected function isTemplateString($ident) |
||
34 | |||
35 | /** |
||
36 | * Convert an identifier to a file path. |
||
37 | * |
||
38 | * @param string $ident The identifier to convert. |
||
39 | * @return string |
||
40 | */ |
||
41 | protected function filenameFromIdent($ident) |
||
48 | |||
49 | /** |
||
50 | * Twig_LoaderInterface > getSource() |
||
51 | * |
||
52 | * Gets the source code of a template, given its name. |
||
53 | * |
||
54 | * @param string $name The name of the template to load. |
||
55 | * @return string The template source code. |
||
56 | */ |
||
57 | public function getSource($name) |
||
61 | |||
62 | /** |
||
63 | * Twig_LoaderInterface > getSourceContext() |
||
64 | * |
||
65 | * Gets the source code of a template, given its name. |
||
66 | * For Twig 2.x |
||
67 | * |
||
68 | * @param string $name The name of the template to load. |
||
69 | * @return Twig_Source The template source object. |
||
70 | */ |
||
71 | public function getSourceContext($name) |
||
76 | |||
77 | /** |
||
78 | * Twig_LoaderInterface > exists() |
||
79 | * |
||
80 | * For Twig 2.x |
||
81 | * |
||
82 | * @param string $name The name of the template to load. |
||
83 | * @return boolean |
||
84 | */ |
||
85 | public function exists($name) |
||
89 | |||
90 | /** |
||
91 | * Twig_LoaderInterface > getCacheKey() |
||
92 | * |
||
93 | * Gets the cache key to use for the cache for a given template name. |
||
94 | * |
||
95 | * @param string $name The name of the template to load. |
||
96 | * @return string|null The cache key |
||
97 | */ |
||
98 | public function getCacheKey($name) |
||
103 | |||
104 | /** |
||
105 | * Twig_LoaderInterface > isFresh() |
||
106 | * |
||
107 | * Returns true if the template is still fresh. |
||
108 | * |
||
109 | * @param string $name The template name. |
||
110 | * @param integer $time The last modification time of the cached template. |
||
111 | * @return boolean |
||
112 | */ |
||
113 | public function isFresh($name, $time) |
||
119 | } |
||
120 |
This check looks for access to methods that are not accessible from the current context.
If you need to make a method accessible to another context you can raise its visibility level in the defining class.