src/Controller/App/HomeController.php line 15

Open in your IDE?
  1. <?php
  2. namespace Controller\App;
  3. use Symfony\Component\HttpFoundation\RedirectResponse;
  4. use Symfony\Component\Routing\Annotation\Route;
  5. use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
  6. use Symfony\Component\Security\Core\Security;
  7. class HomeController
  8. {
  9.     /**
  10.      * @Route("/", name="homepage", methods={"GET"})
  11.      */
  12.     public function homepage(Security $securityUrlGeneratorInterface $urlGenerator)
  13.     {
  14.         $user $security->getUser();
  15.         $landingPage $user->getUser()['landing_page'] ?? 'home.get.overview';
  16.         return new RedirectResponse($urlGenerator->generate($landingPage));
  17.     }
  18. }