src/Controller/StudentSecurityController.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  4. use Symfony\Component\HttpFoundation\Response;
  5. use Symfony\Component\Routing\Annotation\Route;
  6. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  7.     /**
  8.      * @Route("/student")
  9.      */
  10. class StudentSecurityController extends AbstractController
  11. {
  12.     /**
  13.      * @Route("/login", name="student_login")
  14.      */
  15.     public function login(AuthenticationUtils $authenticationUtils): Response
  16.     {
  17.        
  18.         // if ($this->getUser()) {
  19.         //     return $this->redirectToRoute('target_path');
  20.         // }
  21.         // get the login error if there is one
  22.         $error $authenticationUtils->getLastAuthenticationError();
  23.         // last username entered by the user
  24.         $lastUsername $authenticationUtils->getLastUsername();
  25.         // dd("Called");
  26.         $name=strtolower($this->getParameter('university_short_name'));
  27.         
  28.         return $this->render('landing/'.$name.'_index_stud.html.twig', ['last_username' => $lastUsername'error' => $error]);
  29.     }
  30.     /**
  31.      * @Route("/logout", name="student_logout")
  32.      */
  33.     public function logout()
  34.     {
  35.         throw new \LogicException('This method can be blank - it will be intercepted by the logout key on your firewall.');
  36.     }
  37. }