generated from WildCodeSchool/simple-mvc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from WildCodeSchool-2023-09/feature-filtre-cat…
…egories Feature filtre categories
- Loading branch information
Showing
9 changed files
with
190 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{% extends 'layout.html.twig' %} | ||
|
||
{% block title %}Résultats de Recherche{% endblock %} | ||
|
||
{% block content %} | ||
|
||
<form action="/search" method="get"> | ||
<input type="text" name="search_term" placeholder="Rechercher un article par catégorie..."> | ||
<button type="submit">Rechercher</button> | ||
</form> | ||
|
||
|
||
{% if search_term %} | ||
<h1>Résultats de recherche pour la catégorie: "{{ search_term }}"</h1> | ||
{% else %} | ||
<h1>Affichage de tous les articles</h1> | ||
{% endif %} | ||
|
||
{% if articles is not empty %} | ||
<ul> | ||
{% for article in articles %} | ||
<li> | ||
<h2>{{ article.title }}</h2> | ||
<p>{{ article.content | raw }}</p> | ||
<p>Posté le {{ article.date | date('d/m/Y à H:i') }}</p> | ||
<p>Par {{ article.author_name }}</p> | ||
<a href="/show?id={{ article.id }}">Voir les commentaires</a> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
{% else %} | ||
<p>Aucun article trouvé pour "{{ searchTerm }}".</p> | ||
{% endif %} | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters