lib/EigyoSlideBundle/src/Controller/SecurityController.php line 22

Open in your IDE?
  1. <?php
  2. namespace Times\EigyoSlideBundle\Controller;
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  4. use Symfony\Component\HttpFoundation\Response;
  5. use Symfony\Component\Routing\Annotation\Route;
  6. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  7. /**
  8.  * 認証コントローラ
  9.  *
  10.  * @author kawaguchi@kuzilla.co.jp
  11.  */
  12. class SecurityController extends AbstractController
  13. {
  14.     /**
  15.      * ログインアクション
  16.      * @param \Symfony\Component\HttpFoundation\Request $request
  17.      * @return Response
  18.      */
  19.     public function loginAction(AuthenticationUtils $authenticationUtils)
  20.     {
  21.         // get the login error if there is one
  22.         $error $authenticationUtils->getLastAuthenticationError();
  23.         // last username entered by the user
  24.         $lastUsername $authenticationUtils->getLastUsername();
  25.         return $this->render('@TimesEigyoSlide/Security/login.html.twig', array(
  26.             'last_username' => $lastUsername,
  27.             'error' => $error,
  28.         ));
  29.     }
  30. }