| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 28 | public function getSourceContext($name) |
||
| 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 | |||
| 36 | $escapedName = addslashes($name); |
||
| 37 | $prefix = "{% comments '{$escapedName}' %}" . PHP_EOL; |
||
| 38 | $suffix = PHP_EOL . "{% endcomments %}"; |
||
| 39 | |||
| 40 | return new Twig_Source($prefix . file_get_contents($template) . $suffix, $name, $template); |
||
| 41 | } |
||
| 60 |