src/Flexy/FrontBundle/Controller/BookingController.php line 23

Open in your IDE?
  1. <?php
  2. namespace App\Flexy\FrontBundle\Controller;
  3. use App\Flexy\FrontBundle\Entity\PubBanner;
  4. use App\Flexy\FrontBundle\Repository\CategoryProductFrontRepository;
  5. use App\Flexy\FrontBundle\Repository\MasterSliderRepository;
  6. use App\Flexy\FrontBundle\Repository\OfferRepository;
  7. use App\Flexy\FrontBundle\Repository\BrandRepository;
  8. use App\Flexy\FrontBundle\Repository\PubBannerRepository;
  9. use App\Flexy\ShopBundle\Repository\Product\ProductRepository;
  10. use App\Flexy\FrontBundle\Repository\ProductFrontRepository;
  11. use App\Flexy\ShopBundle\Entity\Product\Product;
  12. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  13. use Symfony\Component\HttpFoundation\Response;
  14. use Symfony\Component\Routing\Annotation\Route;
  15.  
  16. #[Route('/booking')]
  17. class BookingController extends AbstractController
  18. {
  19.     #[Route('/'name'index_booking')]
  20.     public function index(
  21.         OfferRepository $offerRepository,
  22.         CategoryProductFrontRepository $categoryProductFrontRepository,
  23.         BrandRepository $brandRepository
  24.         
  25.         ): Response
  26.     {
  27.         // dd($offerRepository->findByValidbrand());
  28.         
  29.         $offers $offerRepository->findByValid();
  30.         $offrebrand $offerRepository->findByValidbrand();
  31.         return $this->render('@Flexy\FrontBundle/templates/booking/index.html.twig', [
  32.             'offers' => $offers,
  33.             'offrebrand'=> $offrebrand,
  34.             'categoriesProduct'=> $categoryProductFrontRepository->findBy(["forProductType"=>"offer"]),
  35.             'brand'=>$brandRepository->findAll(),
  36.         ]);
  37.     }
  38.     #[Route('/single-offer/{id}'name'single_offer')]
  39.     public function singleOffer(
  40.         Product $offer,
  41.         CategoryProductFrontRepository $categoryProductFrontRepository,
  42.         
  43.         ): Response
  44.     {
  45.         
  46.         return $this->render('@Flexy\FrontBundle/templates/booking/singleOffer/singleOffer.html.twig', [
  47.             'singleOffer' => $offer,
  48.             'categoriesProduct'=> $categoryProductFrontRepository->findBy(["forProductType"=>"offer"]),
  49.             
  50.         ]);
  51.     }
  52. }