packages/Menke/UserBundle/Controller/SecurityController.php line 14

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