src/Controller/MainController.php line 30

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Privilege\RoleFactoryInterface;
  4. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  5. use Symfony\Component\HttpFoundation\Response;
  6. use Symfony\Component\Routing\Annotation\Route;
  7. /**
  8.  * @Route("", name="main")
  9.  */
  10. class MainController extends AbstractController
  11. {
  12.     /**
  13.      * @Route("", name="")
  14.      */
  15.     public function index(): Response
  16.     {
  17.         if ($this->isGranted(RoleFactoryInterface::IS_AUTHENTICATED_FULLY)) {
  18.             return $this->redirectToRoute('subject_search');
  19.         }
  20.         return $this->render('main/index.html.twig');
  21.     }
  22.     /**
  23.      * @Route("/regulations", name="_regulations")
  24.      */
  25.     public function regulations(): Response
  26.     {
  27.         return $this->render('main/regulations.html.twig');
  28.     }
  29. }