| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 58 | public function render($templateName, array $parameters = array()) |
||
| 59 | { |
||
| 60 | foreach ($this->paths as $path) { |
||
| 61 | $fullPath = $path . DIRECTORY_SEPARATOR . $templateName; |
||
| 62 | if (file_exists($fullPath)) { |
||
| 63 | extract($parameters, EXTR_SKIP); |
||
| 64 | ob_start(); |
||
| 65 | require $fullPath; |
||
| 66 | return ob_get_clean(); |
||
| 67 | } |
||
| 68 | } |
||
| 69 | |||
| 70 | throw new \RuntimeException(sprintf('The template %s cannot be found.', $templateName)); |
||
| 71 | } |
||
| 72 | } |
||
| 73 |