| Conditions | 2 |
| Paths | 3 |
| Total Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function render(string $viewName, array $_data): string |
||
| 19 | { |
||
| 20 | ob_start(); |
||
| 21 | |||
| 22 | $viewFile = "{$this->viewPath}/{$viewName}.php"; |
||
| 23 | |||
| 24 | try { |
||
| 25 | extract((array) $_data, EXTR_OVERWRITE); |
||
|
|
|||
| 26 | |||
| 27 | include $viewFile; |
||
| 28 | } catch (Exception $exception) { |
||
| 29 | $viewException = new ViewException($exception->getMessage()); |
||
| 30 | $viewException->setView($viewFile); |
||
| 31 | $viewException->setViewData($_data); |
||
| 32 | |||
| 33 | throw $viewException; |
||
| 34 | } |
||
| 35 | |||
| 36 | return ob_get_clean(); |
||
| 37 | } |
||
| 38 | |||
| 44 |