src/Controller/FrontOffice/HomeController.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Controller\FrontOffice;
  3. use App\Controller\MaestroController;
  4. use App\Repository\MaterialRepository;
  5. use App\Repository\StudioRepository;
  6. use Symfony\Component\Routing\Annotation\Route;
  7. class HomeController extends MaestroController
  8. {
  9.     /**
  10.      * @Route ("/", name="home")
  11.      */
  12.     public function home(StudioRepository $studioRepositoryMaterialRepository $materialRepository)
  13.     {
  14.         /** Get Studio_gallery for the carousel */
  15.         $studio $studioRepository->findOneBy(['homepage'=>1]);
  16.         /** Get two last Materials */
  17.         $materials $materialRepository->findLast(2);
  18.         return $this->maestroRender("front-office/home.html.twig",[
  19.             'studio' => $studio,
  20.             'materials' => $materials
  21.         ]);
  22.     }
  23. }