src/Controller/EvenementController.php line 13

Open in your IDE?
  1. <?php 
  2. namespace App\Controller;
  3. use App\Repository\EventRepository;
  4. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  5. use Symfony\Component\HttpFoundation\Response;
  6. use Symfony\Component\Routing\Annotation\Route;
  7. class EvenementController extends AbstractController
  8. {
  9.     #[Route('/evenements'name'event')]
  10.     public function event(EventRepository $eventRepository): Response
  11.     {
  12.         $events $eventRepository->findAll('DESC');
  13.         return $this->render('pages/evenement.html.twig', [
  14.             'events' => $events,
  15.         ]);
  16.     }
  17.     #[Route('/evenement/1'name'evenement1')]
  18.     public function evenement1(): Response
  19.     {
  20.         return $this->render('pages/evenement/1.html.twig', []);
  21.     }
  22. }