src/Controller/Web/IndexController.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Web;
  3. use App\Entity\Salaried;
  4. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  5. use Symfony\Component\HttpFoundation\Response;
  6. use Symfony\Component\Routing\Annotation\Route;
  7. class IndexController extends AbstractController
  8. {
  9.     /**
  10.      * @Route("/", name="index_presentation", options = { "expose" = true }, methods={"GET","HEAD"})
  11.      */
  12.     public function index() : Response
  13.     {
  14.         $connectedUser $this->getUser();
  15.         if (!$connectedUser) {
  16.             return $this->render('Index/indexPresentation.html.twig', array());
  17.         }
  18.         $allSalaried $this->getDoctrine()->getRepository(Salaried::class)
  19.             ->findAll();
  20.         $salariedBasicInfo = array();
  21.         foreach ($allSalaried as $salaried) {
  22.             array_push($salariedBasicInfo, array('id' => $salaried->getId(), 'name' => ($salaried->getFirstName30004()." ".$salaried->getFamilyName30002())));
  23.         }
  24.         return $this->render('Index/index.html.twig', array('salariedList' => $salariedBasicInfo));
  25.     }
  26.     /**
  27.      * @Route("/cgu", name="cgu", options = { "expose" = true }, methods={"GET","HEAD"})
  28.      * @return Response
  29.      */
  30.     public function cgu() : Response
  31.     {
  32.         return $this->render('CGU/cgu.html.twig', array());
  33.     }
  34.     /**
  35.      * @Route("/task-list", name="task_list", options = { "expose" = true }, methods={"GET","HEAD"})
  36.      */
  37.     public function editionList() : Response
  38.     {
  39.         return $this->render('Task/taskList.html.twig', array());
  40.     }
  41. }