src/Controller/AdminLTEController.php line 30

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
  4. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  5. use Symfony\Component\HttpFoundation\Response;
  6. use Symfony\Component\Routing\Annotation\Route;
  7. class AdminLTEController extends AbstractController
  8. {
  9.     /**
  10.      *
  11.      * @IsGranted("ROLE_ADMIN", message="Only Admin!")
  12.      *
  13.      * @Route("/dashboard", name="dashboard")
  14.      */
  15.     public function index() {
  16.         return $this->redirectToRoute('vehicle_index');
  17. //        return $this->render('dashboard/index.html.twig', [
  18. //            'controller_name' => 'AdminLTEController',
  19. //        ]);
  20.     }
  21.     /**
  22.      *
  23.      * @Route("/", name="main_index_action")
  24.      */
  25.     public function main_index_action() {
  26.         if ($this->isGranted('IS_AUTHENTICATED_FULLY')){
  27.             return $this->redirectToRoute('vehicle_index');
  28.         }
  29.         return $this->redirectToRoute('app_login');
  30. //        return new Response($this->render('statuses/403.html.twig', []), 403);
  31.     }
  32. }