| Conditions | 4 |
| Paths | 1 |
| Total Lines | 16 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | public function register(Engine $engine) |
||
| 24 | { |
||
| 25 | $engine->registerFunction('load', function (...$arguments) use ($engine) { |
||
| 26 | $view = array_shift($arguments); |
||
| 27 | $variables = array_shift($arguments); |
||
| 28 | $return = array_shift($arguments); |
||
| 29 | if (is_array($view)) { |
||
| 30 | $view = $engine->buildPath($view); |
||
|
|
|||
| 31 | } |
||
| 32 | $variables = is_array($variables) ? $variables : []; |
||
| 33 | |||
| 34 | $content = $engine->getContents($view, $variables); |
||
| 35 | if (true === $return) { |
||
| 36 | return $content; |
||
| 37 | } |
||
| 38 | echo $content; |
||
| 39 | }); |
||
| 42 |