src/Controller/IndexController.php line 22

  1. <?php
  2. namespace App\Controller;
  3. use App\Entity\ModelType;
  4. use App\Entity\Passerelle;
  5. use App\Entity\PasserellesEnum;
  6. use App\Services\PasserelleService;
  7. use Symfony\Bundle\SecurityBundle\Security;
  8. use Symfony\Component\Routing\Annotation\Route;
  9. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  10. class IndexController extends AbstractController
  11. {
  12.     public function __construct(
  13.         private PasserelleService $passerelleService,
  14.         private Security $security
  15.     ) {
  16.     }
  17.     #[Route('/'name'app_index')]
  18.     public function index()
  19.     {
  20.         /**
  21.          * @var Passerelle[] $passerelles
  22.          */
  23.         $passerelles $this->passerelleService->getPasserellesForUser($this->security->getUser()) ;
  24.         return $this->render('index.html.twig', [
  25.             'passerelles' => $passerelles
  26.         ]) ;
  27.     }
  28. }