src/Controller/DashboardController.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Service\SessionService;
  4. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  5. use Symfony\Component\HttpFoundation\Response;
  6. use Symfony\Component\Routing\Annotation\Route;
  7. use Symfony\Component\HttpFoundation\Request;
  8. class DashboardController extends BaseController
  9. {
  10.     /**
  11.      * @Route("/dashboard", name="Dashboard")
  12.      */
  13.     public function dashboard(SessionService $sessionService): Response
  14.     {
  15.         $user $sessionService->getLoggedUser();
  16.         $loggedIn $user !== null;
  17.         if (! $loggedIn) {
  18.             return $this->baseRender(
  19.                 'hinweis_login.html.twig',
  20.             );
  21.         }
  22.         return $this->baseRender(
  23.             'dashboard.html.twig',
  24.         );
  25.     }
  26. }