Advertisement
homelleon

Untitled

May 12th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. <?php
  2.  
  3. namespace Blogger\UserBundle\Controller;
  4.  
  5. use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  6. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
  7.  
  8. class SecurityController extends Controller {
  9.  
  10. /**
  11. * @Route("/login", name="login")
  12. */
  13. public function loginAction(Request $request) {
  14. $authenticationUtils = $this->get('security.authentication_utils');
  15.  
  16. // get the login error if there is one
  17. $error = $authenticationUtils->getLastAuthenticationError();
  18.  
  19. // last username entered by the user
  20. $lastUsername = $authenticationUtils->getLastUsername();
  21.  
  22. return $this->render('UserBundle:Security:login.html.twig', array(
  23. 'last_username' => $lastUsername,
  24. 'error' => $error,
  25. ));
  26. }
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement