<?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;
class AnnounceController extends AbstractController
{
#[Route('/', name: 'index_announce')]
public function index(
OfferRepository $offerRepository,
CategoryProductFrontRepository $categoryProductFrontRepository,
BrandRepository $brandRepository
): Response
{
$announce = $offerRepository->findByAnnounce();
return $this->render('@Flexy\FrontBundle/templates/announce/index.html.twig', [
'announce' => $announce,
'categoriesProduct'=> $categoryProductFrontRepository->findBy(["forProductType"=>"announce"]),
'brand'=>$brandRepository->findAll(),
]);
}
#[Route('/single_announce/{id}', name: 'single_announce')]
public function singleAnnounce(
Product $announce,
CategoryProductFrontRepository $categoryProductFrontRepository,
): Response
{
return $this->render('@Flexy\FrontBundle/templates/announce/singleAnnounce/singleAnnounce.html.twig', [
'singleAnnounce' => $announce,
'categoriesProduct'=> $categoryProductFrontRepository->findBy(["forProductType"=>"announce"]),
]);
}
}