src/Controller/HomeController.php line 15

Open in your IDE?
  1. <?php 
  2. namespace App\Controller;
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  4. use Symfony\Component\Routing\Annotation\Route;
  5. class HomeController extends AbstractController
  6. {
  7.     /**
  8.      * @Route("/accueil", name="home_page")
  9.      */
  10.     public function index(){
  11.          $user_logged $this->getUser();
  12.         if(empty($user_logged) || empty($user_logged->getId())) {
  13.             return $this->redirectToRoute('app_login');
  14.         }
  15.         return $this->render('home/index.html.twig',[
  16.             'current_menu'=>'accueil',
  17.         ]);
  18.     }
  19. // end HomeController