src/UserPanel/Modules/User/Controller/SecurityController.php line 29

  1. <?php
  2. namespace App\UserPanel\Modules\User\Controller;
  3. use Symfony\Component\HttpFoundation\Request;
  4. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  5. use App\Controller\BaseController;
  6. use App\UserPanel\Modules\User\Form\LoginType;
  7. use App\UserPanel\Modules\User\Form\RegistrationType;
  8. class SecurityController extends BaseController
  9. {
  10.     private $_authenticationUtils;
  11.     
  12.     public function __construct(AuthenticationUtils $authenticationUtils)
  13.     {
  14.         $this->_authenticationUtils $authenticationUtils;
  15.     }
  16.     
  17.     public function login()
  18.     {
  19.         $error $this->_authenticationUtils->getLastAuthenticationError();
  20.         $lastUsername $this->_authenticationUtils->getLastUsername();
  21.         $form $this->createForm(LoginType::class);
  22.         return $this->render('UserPanel/Modules/User/Templates/Security/login.html.twig', array(
  23.             'loginForm' => $form->createView(),
  24.             'registerForm' => $this->createForm(RegistrationType::class),
  25.             'loginError' => $error,
  26.             'activeTab' => 'login'
  27.         ));
  28.     }
  29. }