From 206c9539d62cc9f11e487f5ce2d4a01cddbe0dc9 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Wed, 28 Feb 2024 22:44:29 +0000 Subject: [PATCH] Show a static list of all components --- src/Controller/HomeController.php | 16 ++++++++++++++-- templates/home.html.twig | 10 +++++++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/Controller/HomeController.php b/src/Controller/HomeController.php index 45d9790..97b4634 100644 --- a/src/Controller/HomeController.php +++ b/src/Controller/HomeController.php @@ -13,7 +13,19 @@ final class HomeController extends AbstractController #[Route(path: '/', name: 'home')] public function __invoke(): Response { - // TODO: show a list of all components. - return $this->render('home.html.twig'); + // TODO: make this list dynamic. + $components = [ + ['Logo', 'logo'], + ['Page header', 'page-header'], + ['Footer link', 'footer-link'], + ['Footer', 'footer'], + ]; + + return $this->render( + view: 'home.html.twig', + parameters: [ + 'components' => $components, + ] + ); } } diff --git a/templates/home.html.twig b/templates/home.html.twig index 2fd89ce..541f79b 100644 --- a/templates/home.html.twig +++ b/templates/home.html.twig @@ -1 +1,9 @@ -Home +