Commit ab989dde authored by Valentin Moreau's avatar Valentin Moreau
Browse files

Add: détail des évènements au click.

parent 5ed378d2
......@@ -63,4 +63,20 @@ class DefaultController extends AbstractController
$evs=[$ev1,$ev2,$ev3,$ev4,$ev5,$ev6,$ev7,$ev8,$ev9];
return $evs;
}
#[Route('/Evenements/{nom}', name: 'afficheEvenement')]
public function afficheEvenement(string $nom) {
$arr_events = array_slice($this->chargeDonnees(), 0, 6);
foreach ($arr_events as $event) {
if ($event->getNom() == $nom) {
$theEvent = $event;
}
}
return $this->render('default/detailEvenement.html.twig', [
'controller_name' => 'DefaultController',
'event' => $theEvent
]);
}
}
<h1>Détail de l'évènement : {{ event.nom }}</h1>
<p>Date : {{ event.date|date('Y-m-d') }}</p>
<p>description : {{ event.description }}</p>
<img src={{ asset(event.image) }} alt="" />
\ No newline at end of file
......@@ -28,7 +28,7 @@
<ul id="filter-container-feature" class="feature">
{% for event in events %}
<li>
<a href="#" class="thumb" ><img src={{ asset(event.image) }} alt="" />
<a href="{{ path('afficheEvenement', {nom: event.nom}) }}" class="thumb" ><img src={{ asset(event.image) }} alt="" />
<div class="date"><span class="d">{{ event.date|date('d') }}</span><span class="m">{{ event.date|date('m') }}</span></div>
</a>
<div class="caption">{{ event.description|u.truncate(20) }}</div>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment