Elcodi\Store\UserBundle\Controller\SecurityController::loginAction PHP Méthode

loginAction() public méthode

Login page
public loginAction ( Symfony\Component\Form\FormView $loginFormView ) : Response
$loginFormView Symfony\Component\Form\FormView Login form view
Résultat Symfony\Component\HttpFoundation\Response Response
    public function loginAction(FormView $loginFormView)
    {
        $translator = $this->get('translator');
        /**
         * If user is already logged, go to redirect url
         */
        $authorizationChecker = $this->get('security.authorization_checker');
        if ($authorizationChecker->isGranted('ROLE_CUSTOMER')) {
            return $this->redirectToRoute('store_homepage');
        }
        /**
         * Checking for authentication errors in session
         */
        $session = $this->get('session');
        if ($session->has(Security::AUTHENTICATION_ERROR)) {
            $message = $translator->trans('store.login.wrong_combination');
            $this->addFlash('error', $message);
        }
        return $this->renderTemplate('Pages:user-login.html.twig', ['form' => $loginFormView]);
    }