Conditions | 4 |
Paths | 11 |
Total Lines | 18 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
22 | public function render() |
||
23 | { |
||
24 | try { |
||
25 | $templatePath = "{$this->path}{$this->template}.php"; |
||
26 | if (!is_file($templatePath)) { |
||
27 | throw new \ErrorException('Template file not found'); |
||
28 | } |
||
29 | ob_start(); |
||
30 | include $templatePath; |
||
31 | $output = ob_get_clean(); |
||
32 | } catch (\Throwable $e) { // php7 |
||
33 | ob_end_clean(); |
||
34 | throw $e; |
||
35 | } catch (\Exception $e) { // php5 |
||
36 | ob_end_clean(); |
||
37 | throw $e; |
||
38 | } |
||
39 | return $output; |
||
40 | } |
||
42 |