src/Controller/Backend/SecurityController.php line 18

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