<?php
namespace App\Controller;
use App\Entity\Categorie;
use App\Repository\CategorieRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class ListSpaController extends AbstractController
{
/**
* @Route("/tous-les-spas", name="app_list_spa")
*/
public function index(CategorieRepository $categorieRepository): Response
{
$categoriesParentList = $categorieRepository->findByNoChild();
return $this->render('list_spa/index.html.twig', [
'categories_parent_list' => $categoriesParentList,
'controller_name' => 'ListSpaController',
]);
}
/**
* @Route("/spa/{type}/{id_categorie}", name="app_list_product_per_categ")
*/
public function listsOfOneCategories(CategorieRepository $categorieRepository, $type=null, $id_categorie=null){
$parentCategorie = $categorieRepository->find($id_categorie);
return $this->render('list_spa/list_product_in_categorie.html.twig', [
'categ' => $parentCategorie
]);
}
/**
* @Route("/spas/tous-les-spas", name="app_tous_list_spa")
*/
public function listAllProductIntegral(CategorieRepository $categorieRepository): Response
{
$categoriesParentList = $categorieRepository->findByNoChild();
return $this->render('list_spa/list_integral.html.twig', [
'categories_parent_list' => $categoriesParentList,
'controller_name' => 'ListSpaController',
]);
}
}