Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
28 | public function getSourceContext($name): Source |
||
29 | { |
||
30 | $template = $this->_resolveTemplate($name); |
||
31 | |||
32 | if (!is_readable($template)) { |
||
33 | throw new TemplateLoaderException($name, Craft::t('app', 'Tried to read the template at {path}, but could not. Check the permissions.', ['path' => $template])); |
||
34 | } |
||
35 | $escapedName = addslashes($name); |
||
36 | $prefix = "{% comments '{$escapedName}' %}" . PHP_EOL; |
||
37 | $suffix = PHP_EOL . "{% endcomments %}"; |
||
38 | |||
39 | return new Source($prefix . file_get_contents($template) . $suffix, $name, $template); |
||
40 | } |
||
59 |