diff --git a/config/routes.php b/config/routes.php index c3653c5..d399b9c 100644 --- a/config/routes.php +++ b/config/routes.php @@ -1,4 +1,2 @@ get('/', function () { - require_once __DIR__ . '/../templates/base.php'; -}); \ No newline at end of file +$router->get('/', '/', [new HomeController(), 'home']); \ No newline at end of file diff --git a/src/Controller/BaseController.php b/src/Controller/BaseController.php new file mode 100644 index 0000000..391fd8e --- /dev/null +++ b/src/Controller/BaseController.php @@ -0,0 +1,32 @@ +render('home', [ + 'title' => 'Willkommen' + ]); + } +} \ No newline at end of file diff --git a/templates/base.php b/templates/base.php deleted file mode 100644 index bba7f56..0000000 --- a/templates/base.php +++ /dev/null @@ -1,10 +0,0 @@ - -

Welcome

-

This is the homepage.

- + +

+

Willkommen auf meiner Seite!

+ + - + - - <?= $title ?? 'Acme' ?> + <?= htmlspecialchars($title) ?>