src/Controller/Front/HomeController.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Front;
  3. use App\Repository\ContentRepository;
  4. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  5. use Symfony\Component\Routing\Annotation\Route;
  6. class HomeController extends AbstractController
  7. {
  8.     /**
  9.      * @Route("/", name="front_home_index")
  10.      */
  11.     public function index(ContentRepository $contentRepository)
  12.     {
  13.         return $this->render('front/index.html.twig', [
  14.             'content_header' => $contentRepository->findOneBy(['page' => 'accueil''section' => 'header']),
  15.             'block_image_1' => $contentRepository->findOneBy(['page' => 'accueil''section' => 'block_image_1']),
  16.             'block_image_2' => $contentRepository->findOneBy(['page' => 'accueil''section' => 'block_image_2']),
  17.             'block_image_3' => $contentRepository->findOneBy(['page' => 'accueil''section' => 'block_image_3']),
  18.             'block_image_4' => $contentRepository->findOneBy(['page' => 'accueil''section' => 'block_image_4']),
  19.             'block_image_5' => $contentRepository->findOneBy(['page' => 'accueil''section' => 'block_image_5']),
  20.             'bandeau' => $contentRepository->findOneBy(['page' => 'accueil''section' => 'bandeau'])
  21.         ]);
  22.     }
  23. }