src/Controller/DashboardController.php line 15

Open in your IDE?
  1. <?php
  2.  
  3. namespace App\Controller;
  4.  
  5. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  6. use Symfony\Component\HttpFoundation\Response;
  7. use Symfony\Component\Routing\Annotation\Route;
  8. use Symfony\Component\HttpFoundation\JsonResponse;
  9.  
  10. class DashboardController extends AbstractController
  11. {
  12.     /**
  13.      * @Route("/", name="index")
  14.      */
  15.     public function index(): Response
  16.     {
  17.         //return new JsonResponse(array('message' => '/register or /login! or if logged in, /dashboard'));
  18.         return $this->render('index/index.html.twig', [
  19.             'controller_name' => 'indexController',
  20.         ]);
  21.     }
  22.     /**
  23.      * @Route("/dashboard", name="dashboard")
  24.      */
  25.     public function dashboard(): Response
  26.     {
  27.         $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');
  28.         return $this->render('dashboard/index.html.twig', [
  29.             'controller_name' => 'DashboardController',
  30.         ]);
  31.     }
  32. }