diff options
Diffstat (limited to 'src/helpers.php')
-rw-r--r-- | src/helpers.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/helpers.php b/src/helpers.php index a410b27e..d44d1d21 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -3,6 +3,7 @@ use Engelsystem\Config\Config; use Engelsystem\Http\Request; +use Engelsystem\Renderer\Renderer; /** * Get or set config values @@ -39,3 +40,19 @@ function request($key = null, $default = null) return $request->input($key, $default); } + +/** + * @param string $template + * @param mixed[] $data + * @return Renderer|string + */ +function view($template = null, $data = null) +{ + $renderer = Renderer::getInstance(); + + if (is_null($template)) { + return $renderer; + } + + return $renderer->render($template, $data); +} |