src/Controller/SecurityController.php line 16

Open in your IDE?
  1. <?php
  2. // src/Controller/BuyerController.php
  3. namespace App\Controller;
  4. use Symfony\Component\Routing\Annotation\Route;
  5. use Symfony\Component\HttpFoundation\Response;
  6. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  7. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  8. use Symfony\Component\HttpFoundation\Request;
  9. class SecurityController  extends AbstractController
  10. {
  11.     /**
  12.      * @Route("/login", name="login")
  13.      */
  14.     public function login(Request $requestAuthenticationUtils $authenticationUtils)
  15.     {
  16.         // get the login error if there is one
  17.         $error $authenticationUtils->getLastAuthenticationError();
  18.         // last username entered by the user
  19.         $lastUsername $authenticationUtils->getLastUsername();
  20.         return $this->render('security/login.html.twig', array(
  21.             'last_username' => $lastUsername,
  22.             'error'         => $error,
  23.         ));
  24.     }
  25. }