src/Controller/DefaultController.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Security\RoleManager;
  4. use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
  5. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  6. use Symfony\Component\Routing\Annotation\Route;
  7. class DefaultController extends AbstractController
  8. {
  9.     /**
  10.      * @Route("/", name="home")
  11.      */
  12.     public function index()
  13.     {
  14.         $this->denyAccessUnlessGranted("IS_AUTHENTICATED_FULLY");
  15.         return $this->redirectToRoute("admin_home");
  16.     }
  17.     /**
  18.      * @Route("/admin/dashboard", name="admin_home")
  19.      */
  20.     public function indexAdmin()
  21.     {
  22.         $this->denyAccessUnlessGranted("IS_AUTHENTICATED_FULLY");
  23.         return $this->render('admin/home.html.twig', [
  24.             'controller_name' =>  '',
  25.         ]);
  26.     }
  27. }