src/Controller/AppController.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use Doctrine\ORM\EntityManagerInterface;
  4. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  5. use Symfony\Component\HttpFoundation\RequestStack;
  6. use Symfony\Component\HttpFoundation\Response;
  7. use Symfony\Component\Routing\Annotation\Route;
  8. class AppController extends AbstractController
  9. {
  10.     public function __construct()
  11.     {
  12.     }
  13.     #[Route('/'name'home')]
  14.     public function home(): Response
  15.     {
  16.         if ($this->isGranted('ROLE_ADMIN')) {
  17.             return $this->redirectToRoute('tools_home');
  18.         }
  19.         if ($this->isGranted('ROLE_CLUB_MANAGER')) {
  20.             return $this->redirectToRoute('bo_home');
  21.         }
  22.         return $this->redirectToRoute('app_logout');
  23.     }
  24. }