src/Controller/HomeController.php line 56

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Repository\HeadersRepository;
  4. use App\Repository\ProductRepository;
  5. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  6. use Symfony\Component\HttpFoundation\Response;
  7. use Symfony\Component\Routing\Annotation\Route;
  8. class HomeController extends AbstractController
  9. {
  10.     #[Route('/'name'home')]
  11.     public function index(ProductRepository $productRepositoryHeadersRepository $headersRepository): Response
  12.     {
  13.         $products $productRepository->findByIsInHome(1);
  14.         $headers $headersRepository->findAll();
  15.         return $this->render('home/index.html.twig', [
  16.             'carousel' => true,  //Le caroussel ne s'affiche que sur la page d'accueil (voir base.twig)
  17.             'top_products' => $products,
  18.             'headers' => $headers
  19.         ]);
  20.     }
  21.     #[Route('a-propos'name'about')]
  22.     public function about(): Response
  23.     {
  24.         return $this->render('home/about.html.twig');
  25.     }
  26.     #[Route('rĂ©alissations-r'name'realisations')]
  27.     public function realisations(): Response
  28.     {
  29.         return $this->render('home/realisations.html.twig');
  30.     }
  31.     #[Route('invectus-i'name'invectus')]
  32.     public function invectus(): Response
  33.     {
  34.         return $this->render('home/invectus.html.twig');
  35.     }
  36.     #[Route('yaxanal-t'name'yaxanal')]
  37.     public function yaxanal(): Response
  38.     {
  39.         return $this->render('home/yaxanal.html.twig');
  40.     }
  41.     #[Route('tolukeur-t'name'tolukeur')]
  42.     public function tolukeur(): Response
  43.     {
  44.         return $this->render('home/tolukeur.html.twig');
  45.     }
  46.     #[Route('bujuplast-b'name'bujuplast')]
  47.     public function bujuplast(): Response
  48.     {
  49.         return $this->render('home/bujuplast.html.twig');
  50.     }
  51.     #[Route('ascenseur-a'name'ascenseur')]
  52.     public function ascenseur(): Response
  53.     {
  54.         return $this->render('home/ascenseur.html.twig');
  55.     }
  56.     #[Route('feu-f'name'feu')]
  57.     public function feu(): Response
  58.     {
  59.         return $this->render('home/feu.html.twig');
  60.     }
  61.     #[Route('alimentation'name'alimentation')]
  62.     public function alimentation(): Response
  63.     {
  64.         return $this->render('home/alimentation.html.twig');
  65.     }
  66.     
  67.     #[Route('blog_b'name'blog')]
  68.     public function blog(): Response
  69.     {
  70.         return $this->render('home/blog.html.twig');
  71.     }
  72.     #[Route('coding_b'name'coding')]
  73.     public function coding(): Response
  74.     {
  75.         return $this->render('home/coding.html.twig');
  76.     }
  77.     #[Route('tolu_b'name'tolu')]
  78.     public function tolu(): Response
  79.     {
  80.         return $this->render('home/tolu.html.twig');
  81.     }
  82.     #[Route('hack_b'name'hack')]
  83.     public function hack(): Response
  84.     {
  85.         return $this->render('home/hack.html.twig');
  86.     }
  87. }