src/Admin/Modules/User/Controller/SecurityController.php line 19

  1. <?php
  2. namespace App\Admin\Modules\User\Controller;
  3. use Symfony\Component\HttpFoundation\Request;
  4. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  5. use App\Admin\Controller\BaseController;
  6. use App\Admin\Modules\User\Form\LoginType;
  7. class SecurityController extends BaseController
  8. {
  9.     public function login(Request $requestAuthenticationUtils $authenticationUtils)
  10.     {
  11.         $error $authenticationUtils->getLastAuthenticationError();
  12.         $lastUsername $authenticationUtils->getLastUsername();
  13.         $form $this->createForm(LoginType::class);
  14.         
  15.         $targetPath $request->getSession()->get('_security.admin.target_path'$this->generateUrl('admin_index'));
  16.         return $this->render('Admin/Modules/User/Templates/Security/login.html.twig', array(
  17.             'last_username' => $lastUsername,
  18.             'error' => $error,
  19.             'form' => $form->createView(),
  20.             'targetPath' => $targetPath
  21.         ));
  22.     }
  23. }