src/Controller/Front/Boutique/CoachController.php line 16

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Controller\Front\Boutique;
  4. use App\Entity\User\Coach;
  5. use App\Repository\User\CoachRepository;
  6. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  7. use Symfony\Component\HttpFoundation\Response;
  8. use Symfony\Component\Routing\Annotation\Route;
  9. class CoachController extends AbstractController
  10. {
  11.     #[Route('/coaches'name'app_front_coaches_index'methods: ['GET'])]
  12.     public function index(CoachRepository $coachRepository): Response
  13.     {
  14.         $coaches $coachRepository->findAll();
  15.         return $this->render('front/boutique/coaches/index.html.twig', [
  16.             'coaches' => $coaches,
  17.         ]);
  18.     }
  19.     #[Route('/coach/{name}'name'app_front_coach_detail'methods: ['GET'])]
  20.     public function detail(Coach $coach): Response
  21.     {
  22.         return $this->render('front/boutique/coaches/detail.html.twig', [
  23.             'coach' => $coach,
  24.         ]);
  25.     }
  26.     #[Route('/coach/{name}/cours'name'app_front_coach_cours_index'methods: ['GET'])]
  27.     public function coursIndex(Coach $coach): Response
  28.     {
  29.         return $this->render('front/boutique/cours/index.html.twig', [
  30.             'cours' => $coach->getCours(),
  31.         ]);
  32.     }
  33. }