src/Controller/Affiliate/LoginController.php line 24

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Affiliate;
  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. * @Route("/affiliate")
  9. */
  10. class LoginController extends AbstractController {
  11.     /**
  12.     * @Route("/login", name="affiliate_login")
  13.     */
  14.     public function index(AuthenticationUtils $authenticationUtils): Response {
  15.         // get the login error if there is one
  16.         $error $authenticationUtils->getLastAuthenticationError();
  17.         // last username entered by the user
  18.         $lastUsername $authenticationUtils->getLastUsername();
  19.         return $this->render('/affiliate/login/index.html.twig', [
  20.             'last_username' => $lastUsername,
  21.             'error'         => $error,
  22.         ]);
  23.     }
  24. }