<?php
namespace App\Flexy\FrontBundle\Controller;
use App\Flexy\FrontBundle\Entity\PubBanner;
use App\Flexy\FrontBundle\Repository\CategoryProductFrontRepository;
use App\Flexy\FrontBundle\Repository\MasterSliderRepository;
use App\Flexy\FrontBundle\Repository\OfferRepository;
use App\Flexy\FrontBundle\Repository\BrandRepository;
use App\Flexy\FrontBundle\Repository\PubBannerRepository;
use App\Flexy\ShopBundle\Repository\Product\ProductRepository;
use App\Flexy\FrontBundle\Repository\ProductFrontRepository;
use App\Flexy\ShopBundle\Entity\Product\Product;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
#[Route('/booking')]
class BookingController extends AbstractController
{
#[Route('/', name: 'index_booking')]
public function index(
OfferRepository $offerRepository,
CategoryProductFrontRepository $categoryProductFrontRepository,
BrandRepository $brandRepository
): Response
{
// dd($offerRepository->findByValidbrand());
$offers = $offerRepository->findByValid();
$offrebrand = $offerRepository->findByValidbrand();
return $this->render('@Flexy\FrontBundle/templates/booking/index.html.twig', [
'offers' => $offers,
'offrebrand'=> $offrebrand,
'categoriesProduct'=> $categoryProductFrontRepository->findBy(["forProductType"=>"offer"]),
'brand'=>$brandRepository->findAll(),
]);
}
#[Route('/single-offer/{id}', name: 'single_offer')]
public function singleOffer(
Product $offer,
CategoryProductFrontRepository $categoryProductFrontRepository,
): Response
{
return $this->render('@Flexy\FrontBundle/templates/booking/singleOffer/singleOffer.html.twig', [
'singleOffer' => $offer,
'categoriesProduct'=> $categoryProductFrontRepository->findBy(["forProductType"=>"offer"]),
]);
}
}