src/Flexy/FrontBundle/Controller/AnnounceController.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.  
  17. class AnnounceController extends AbstractController
  18. {
  19.     #[Route('/'name'index_announce')]
  20.     public function index(
  21.         OfferRepository $offerRepository,
  22.         CategoryProductFrontRepository $categoryProductFrontRepository,
  23.         BrandRepository $brandRepository
  24.         
  25.         ): Response
  26.     {
  27.         $announce $offerRepository->findByAnnounce();
  28.         return $this->render('@Flexy\FrontBundle/templates/announce/index.html.twig', [
  29.             'announce' => $announce,
  30.             'categoriesProduct'=> $categoryProductFrontRepository->findBy(["forProductType"=>"announce"]),
  31.             'brand'=>$brandRepository->findAll(),
  32.         ]);
  33.     }
  34.     #[Route('/single_announce/{id}'name'single_announce')]
  35.     public function singleAnnounce(
  36.         Product $announce,
  37.         CategoryProductFrontRepository $categoryProductFrontRepository,
  38.         
  39.         ): Response
  40.     {
  41.         
  42.         return $this->render('@Flexy\FrontBundle/templates/announce/singleAnnounce/singleAnnounce.html.twig', [
  43.             'singleAnnounce' => $announce,
  44.             'categoriesProduct'=> $categoryProductFrontRepository->findBy(["forProductType"=>"announce"]),
  45.             
  46.         ]);
  47.     }
  48. }