yoesoff

UserController.php

Sep 29th, 2019
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.97 KB | None | 0 0
  1. <?php
  2.  
  3. namespace App\Controller;
  4.  
  5. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  6. use Symfony\Component\Routing\Annotation\Route;
  7. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  8.  
  9. class UserController extends AbstractController
  10. {
  11.     /**
  12.      * @Route("/user", name="user")
  13.      */
  14.     public function index()
  15.     {
  16.         return $this->render('user/index.html.twig', [
  17.             'controller_name' => 'UserController',
  18.         ]);
  19.     }
  20.  
  21.     /**
  22.      * @Route("/login", name="security_login")
  23.      */
  24.     public function login(AuthenticationUtils $authenticationUtils)
  25.     {
  26.         return $this->render('user/login.html.twig', [
  27.             'last_username' => $authenticationUtils->getLastUsername(),
  28.             'error' => $authenticationUtils->getLastAuthenticationError()
  29.         ]);
  30.     }
  31.  
  32.     /**
  33.      * @Route("/logout", name="security_logout")
  34.      */
  35.     public function logout()
  36.     {
  37.        
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment