cleaned tree

This commit is contained in:
julien
2026-02-22 20:01:29 +01:00
parent 6ef1eb9508
commit 4c24a4d083
5 changed files with 11 additions and 15 deletions

View File

View File

@@ -17,6 +17,6 @@ return function (App $app) {
/** @var Twig $view */
$view = $request->getAttribute('view'); // <-- récupération correcte
return $view->render($response, 'pages/posts.twig', ['posts' => $posts]);
return $view->render($response, 'pages/home.twig', ['posts' => $posts]);
});
};

View File

@@ -1,4 +1,14 @@
{% extends "layout.twig" %}
{% block title %}Mon Blog{% endblock %}
{% block content %}
{% for post in posts %}
<div class="post">
<h2>{{ post.title }}</h2>
<p>{{ post.content|nl2br }}</p>
</div>
{% else %}
<p>Aucun article publié.</p>
{% endfor %}
{% endblock %}

View File

@@ -1,14 +0,0 @@
{% extends "layout.twig" %}
{% block title %}Articles{% endblock %}
{% block content %}
{% for post in posts %}
<div class="post">
<h2>{{ post.title }}</h2>
<p>{{ post.content|nl2br }}</p>
</div>
{% else %}
<p>Aucun article publié.</p>
{% endfor %}
{% endblock %}