Conditions | 4 |
Paths | 8 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
51 | public function render(string $viewName = ''): string |
||
52 | { |
||
53 | if ($viewName === '') { |
||
54 | $viewName = $this->viewName; |
||
55 | } |
||
56 | |||
57 | if ($viewName === '') { |
||
58 | $viewName = 'Default'; |
||
59 | } |
||
60 | |||
61 | if (method_exists($this, 'view' . $viewName)) { |
||
62 | return call_user_func([ |
||
63 | $this, |
||
64 | 'view' . $viewName |
||
65 | ]); |
||
66 | } |
||
67 | |||
68 | throw (new \Exception('View ' . $viewName . ' was not found')); |
||
69 | } |
||
81 |