From af3d696aed450ea9a2e24db1cb07836f7d83b5d2 Mon Sep 17 00:00:00 2001 From: therselman Date: Fri, 14 Jul 2017 00:15:05 +0200 Subject: [PATCH] --- src/config/container.php | 1 + src/controllers/AdminController.php | 1 - src/elements/index/view.php | 1 + src/layouts/public.php | 12 +++++++++--- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/config/container.php b/src/config/container.php index 77b2373..22bbe20 100644 --- a/src/config/container.php +++ b/src/config/container.php @@ -40,6 +40,7 @@ return [ $whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler); // $whoops->pushHandler(new \Whoops\Handler\JsonResponseHandler); $whoops->register(); + $c->request->execute_route(require __DIR__ . '/routes.php'); }, diff --git a/src/controllers/AdminController.php b/src/controllers/AdminController.php index e6ee6f5..76f7652 100644 --- a/src/controllers/AdminController.php +++ b/src/controllers/AdminController.php @@ -4,7 +4,6 @@ class AdminController extends Controller { function indexAction() { - } function clubAction($id) diff --git a/src/elements/index/view.php b/src/elements/index/view.php index e69de29..e6f4275 100644 --- a/src/elements/index/view.php +++ b/src/elements/index/view.php @@ -0,0 +1 @@ +Hello World diff --git a/src/layouts/public.php b/src/layouts/public.php index 781bee4..07ea453 100644 --- a/src/layouts/public.php +++ b/src/layouts/public.php @@ -48,9 +48,15 @@ return function($response) '' . '
'; - require __DIR__ . '/../elements/' . $response->elements['header'] . '/view.php'; - require __DIR__ . '/../elements/' . $response->elements['content'] . '/view.php'; - require __DIR__ . '/../elements/' . $response->elements['footer'] . '/view.php'; + // require __DIR__ . '/../elements/' . $response->elements['header'] . '/view.php'; + // require __DIR__ . '/../elements/' . $response->elements['content'] . '/view.php'; + // require __DIR__ . '/../elements/' . $response->elements['footer'] . '/view.php'; + + $path = $response->container->config['paths']['elements']; + + require $path . $response->elements['header'] . '/view.php'; + require $path . $response->elements['content'] . '/view.php'; + require $path . $response->elements['footer'] . '/view.php'; echo '
' .