Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Blogger\UserBundle\Controller;
- use Symfony\Bundle\FrameworkBundle\Controller\Controller;
- use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
- class SecurityController extends Controller {
- /**
- * @Route("/login", name="login")
- */
- public function loginAction(Request $request) {
- $authenticationUtils = $this->get('security.authentication_utils');
- // get the login error if there is one
- $error = $authenticationUtils->getLastAuthenticationError();
- // last username entered by the user
- $lastUsername = $authenticationUtils->getLastUsername();
- return $this->render('UserBundle:Security:login.html.twig', array(
- 'last_username' => $lastUsername,
- 'error' => $error,
- ));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement