src/Controller/FrontController.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use Symfony\Component\Routing\Annotation\Route;
  4. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  5. use Symfony\Component\HttpFoundation\Response;
  6. class FrontController extends AbstractController
  7. {
  8.     /**
  9.      * @Route("/", name="home")
  10.      */
  11.     public function home(): Response
  12.     {
  13.         if ($this->isGranted('ROLE_USER')) {
  14.             return $this->redirectToRoute('dashboard', [], Response::HTTP_SEE_OTHER);
  15.         } 
  16.         return $this->redirectToRoute('app_login', [], Response::HTTP_SEE_OTHER);
  17.         /*
  18.         return $this->render('home.html.twig', [
  19.             
  20.         ]);
  21.         */
  22.     }
  23. }