<?php
declare(strict_types=1);
namespace App\Controller\Front\Boutique;
use App\Entity\User\Coach;
use App\Repository\User\CoachRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class CoachController extends AbstractController
{
#[Route('/coaches', name: 'app_front_coaches_index', methods: ['GET'])]
public function index(CoachRepository $coachRepository): Response
{
$coaches = $coachRepository->findAll();
return $this->render('front/boutique/coaches/index.html.twig', [
'coaches' => $coaches,
]);
}
#[Route('/coach/{name}', name: 'app_front_coach_detail', methods: ['GET'])]
public function detail(Coach $coach): Response
{
return $this->render('front/boutique/coaches/detail.html.twig', [
'coach' => $coach,
]);
}
#[Route('/coach/{name}/cours', name: 'app_front_coach_cours_index', methods: ['GET'])]
public function coursIndex(Coach $coach): Response
{
return $this->render('front/boutique/cours/index.html.twig', [
'cours' => $coach->getCours(),
]);
}
}