groupeRepository = $groupeRepository; $this->affichageRepository = $affichageRepository; } #[Route('/', name: 'frontend_home_index')] public function index(ServiceHome $serviceHome): Response { return $this->render('frontend/home/index.html.twig', [ 'shows' => $serviceHome->show(), 'groupes' => $this->groupeRepository->findAll() ]); } #[Route('/frontend/home/profile', name: 'frontend_home_profile')] public function profile(): Response { return $this->render('frontend/home/profile.html.twig', [ 'titlePage' => 'Inscription', ]); } #[Route('/frontend/search/groupe/{id}', name: 'frontend_search_groupe')] public function search_groupe(GroupeCategorie $groupeCategorie): Response { $annonces = []; $categories = $groupeCategorie->getCategories(); foreach($categories as $categorie){ foreach($categorie->getAnnonces() as $annonce){ if($annonce->isActive()){ $annonces[] = $annonce; } } } $breadcrumbs[] = ['title'=>"Recherche", 'active'=>false, 'link'=>null]; $breadcrumbs[] = ['title'=>"Groupe Catégories", 'active'=>false, 'link'=>null]; $breadcrumbs[] = ['title'=>$groupeCategorie->getNom(), 'active'=>true, 'link'=>null]; return $this->render('frontend/home/show-promo.html.twig', [ 'annonces' => $annonces, 'breadcrumbs' => $breadcrumbs ]); } #[Route('/frontend/search/categorie/{id}', name: 'frontend_search_categorie')] public function search_categorie(Categorie $categorie): Response { $annonces = []; foreach($categorie->getAnnonces() as $annonce){ if($annonce->isActive()){ $annonces[] = $annonce; } } $breadcrumbs[] = ['title'=>"Recherche", 'active'=>false, 'link'=>null]; $breadcrumbs[] = ['title'=>"Catégories", 'active'=>false, 'link'=>null]; $breadcrumbs[] = ['title'=>$categorie->getNom(), 'active'=>true, 'link'=>null]; return $this->render('frontend/home/show-promo.html.twig', [ 'annonces' => $annonces, 'breadcrumbs' => $breadcrumbs ]); } #[Route('/frontend/search/annonce', name: 'frontend_search_annonce')] public function search_annonce(): Response { $annonces = []; return $this->render('frontend/home/show-promo.html.twig', [ 'annonces' => $annonces, 'breadcrumb' => "Accueil" ]); } }