This commit is contained in:
Marcel Pociot
2020-04-27 10:05:42 +02:00
parent 28c4009dff
commit 054e5b6a86
20 changed files with 737 additions and 461 deletions

View File

@@ -26,12 +26,13 @@ abstract class Controller implements HttpServerInterface
{
}
protected function getView(string $view, array $data)
protected function getView(string $view, array $data = [])
{
$templatePath = implode(DIRECTORY_SEPARATOR, explode('.', $view));
$twig = new Environment(
new ArrayLoader([
'app' => file_get_contents(base_path('resources/views/server/layouts/app.twig')),
'template' => file_get_contents(base_path('resources/views/'.$templatePath.'.twig')),
])
);