<?php
namespace Times\EigyoSlideBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
/**
* 認証コントローラ
*
* @author kawaguchi@kuzilla.co.jp
*/
class SecurityController extends AbstractController
{
/**
* ログインアクション
* @param \Symfony\Component\HttpFoundation\Request $request
* @return Response
*/
public function loginAction(AuthenticationUtils $authenticationUtils)
{
// get the login error if there is one
$error = $authenticationUtils->getLastAuthenticationError();
// last username entered by the user
$lastUsername = $authenticationUtils->getLastUsername();
return $this->render('@TimesEigyoSlide/Security/login.html.twig', array(
'last_username' => $lastUsername,
'error' => $error,
));
}
}