🎨 Mini-projet — Thème Blog complet
Créer le système de templates Twig complet pour le blog Symfony.
🎯 Templates à créer
templates/base.html.twig — layout principal avec blocs
templates/blog/index.html.twig — liste paginée
templates/blog/show.html.twig — détail article
templates/partials/_card.html.twig — carte article réutilisable
templates/partials/_pagination.html.twig — macro pagination
src/Twig/AppExtension.php — filtre |excerpt et |timeago
🎯 Fonctionnalités Twig à utiliser
- Héritage
{% extends %}avec blocstitle,content,stylesheets - Filtre custom
|excerpt(150)via AppExtension - Filtre custom
|timeago(ex: "il y a 2 heures") - Flash messages dans le layout base
- Navigation active avec
app.request.pathInfo - Macro
pagination()dans un fichier séparé