src/Controller/MagasinsController.php line 21
<?phpnamespace App\Controller;use App\Repository\MagasinRepository;use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;use Symfony\Component\HttpFoundation\Response;use Symfony\Component\Routing\Annotation\Route;class MagasinsController extends AbstractController{private $magasinRepository;public function __construct(MagasinRepository $magasinRepository) {$this->magasinRepository = $magasinRepository;}#[Route('/magasins', name: 'app_magasins')]public function index(): Response{$magasin = $this->magasinRepository->findAll();return $this->render('magasins/index.html.twig', ["magasins" => $magasin]);}#[Route('magasins/{slug}', name: 'magasins_details')]public function details($slug): Response{$magasin = $this->magasinRepository->findOneBy(['slug' => $slug]);return $this->render('magasins/details.html.twig', ['magasins' => $magasin,]);}}