src/Controller/DefaultController.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  4. use Symfony\Component\HttpFoundation\RedirectResponse;
  5. use Symfony\Component\HttpFoundation\Response;
  6. use Symfony\Component\Routing\Annotation\Route;
  7. class DefaultController extends AbstractController
  8. {
  9.     /**
  10.      * @Route("/", name="homepage")
  11.      * @return RedirectResponse|Response
  12.      */
  13.     public function indexAction()
  14.     {
  15.         if (!$this->getUser()) {
  16.             return $this->redirectToRoute('app_login');
  17.         }
  18.         return $this->render('Default/index.html.twig');
  19.     }
  20. }