Show a static list of all components

This commit is contained in:
Oliver Davies 2024-02-28 22:44:29 +00:00
parent 93380252f1
commit 206c9539d6
2 changed files with 23 additions and 3 deletions

View file

@ -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,
]
);
}
}

View file

@ -1 +1,9 @@
Home
<ul>
{% for component in components %}
<li>
<a href="{{ component.1 }}">
{{ component.0 }}
</a>
</li>
{% endfor %}
</ul>