src/Controller/Frontend/FrontendController.php line 48

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Frontend;
  3. use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
  4. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  5. use Symfony\Component\Routing\Annotation\Route;
  6. use Symfony\Component\HttpFoundation\Request;
  7. use Symfony\Component\HttpFoundation\Response;
  8. use Symfony\Component\HttpFoundation\RedirectResponse;
  9. use Symfony\Component\String\Slugger\AsciiSlugger;
  10. use Nelmio\ApiDocBundle\Annotation\Security;
  11. use App\Service\AgencyService;
  12. use App\Service\BannerService;
  13. use App\Repository\BikeRepository;
  14. use App\Service\CircuitService;
  15. /**
  16.  * Frontend: Frontend controller.
  17.  * @Route("/", name="frontend")
  18. */
  19. class FrontendController extends AbstractController
  20. {
  21.     /**
  22.      * @Route("/", name="_index")
  23.      */
  24.     public function index()
  25.     {
  26.         return $this->render('index.html.twig');
  27.     }
  28.     public function banner(BannerService $BannerService)
  29.     {
  30.         $banners $BannerService->getBanner(['type'=>'site']);
  31.         return $this->render('widget/banner.html.twig', ['banners' => $banners]);
  32.     }
  33.     public function bike(BikeRepository $BikeRepository)
  34.     {
  35.         $bikes $BikeRepository->groupByBrand();
  36.         return $this->render('widget/bike.html.twig', ['bikes' => $bikes]);
  37.     }
  38.     public function circuit(CircuitService $CircuitService)
  39.     {
  40.         $circuits $CircuitService->getCircuit(['statut' => true]);
  41.         return $this->render('widget/circuit.html.twig', ['circuits' => $circuits]);
  42.     }
  43.     public function agency(AgencyService $AgencyService)
  44.     {
  45.         $agencies $AgencyService->getAgency();
  46.         return $this->render('widget/agency.html.twig', ['agencies' => $agencies]);
  47.     }
  48. }