src/Controller/AccueilController.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Repository\BanniereRepository;
  4. use App\Repository\RealisationRepository;
  5. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  6. use Symfony\Component\HttpFoundation\Response;
  7. use Symfony\Component\Routing\Annotation\Route;
  8. class AccueilController extends AbstractController
  9. {
  10.     #[Route('/'name'app_accueil')]
  11.     public function index(BanniereRepository $banniereRepositoryRealisationRepository $realisationRepository): Response
  12.     {
  13.         $bannieres $banniereRepository->findAll();
  14.         $news $realisationRepository->findNew();
  15.         $all $realisationRepository->findAll();
  16.         shuffle($all);
  17.         return $this->render('accueil/index.html.twig', [
  18.             'bannieres' => $bannieres,
  19.             'news' => $news,
  20.             'all' => $all,
  21.         ]);
  22.     }
  23. }