src/Controller/DefaultController.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Entity\Jeu;
  4. use Doctrine\ORM\EntityManagerInterface;
  5. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  6. use Symfony\Component\Routing\Annotation\Route;
  7. class DefaultController extends AbstractController
  8. {
  9. #[Route('/', name: 'index')]
  10. public function index(EntityManagerInterface $em)
  11. {
  12. //return $this->redirectToRoute('admin');
  13. return $this->render('index.html.twig', [
  14. 'jeux' => $em->getRepository(Jeu::class)->findBy([], ['nom' => 'ASC']),
  15. ]);
  16. }
  17. #[Route('/logout', name: 'app_logout')]
  18. public function logout()
  19. {
  20. // controller can be blank: it will never be executed!
  21. throw new \Exception('This should never be reached!');
  22. }
  23. }