src/Controller/HomeController.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use Symfony\Component\HttpFoundation\Response;
  4. use Symfony\Component\Routing\Annotation\Route;
  5. use Twig\Environment;
  6. class HomeController extends BaseController
  7. {
  8.     public function __construct(Environment $twig)
  9.     {
  10.         $this->isDesktop($twig);
  11.     }
  12.    
  13.     /**
  14.      * @Route("/", name="app_home")
  15.      */
  16.     public function index(): Response
  17.     {
  18.         $user $this->getUser();
  19.         if($user != null){
  20.             return $this->redirectToRoute('view_invoices');
  21.         }
  22.         return $this->render('/home/index.html.twig');
  23.     }
  24. }