<?php
namespace App\Controller\Web;
use App\Entity\Salaried;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class IndexController extends AbstractController
{
/**
* @Route("/", name="index_presentation", options = { "expose" = true }, methods={"GET","HEAD"})
*/
public function index() : Response
{
$connectedUser = $this->getUser();
if (!$connectedUser) {
return $this->render('Index/indexPresentation.html.twig', array());
}
$allSalaried = $this->getDoctrine()->getRepository(Salaried::class)
->findAll();
$salariedBasicInfo = array();
foreach ($allSalaried as $salaried) {
array_push($salariedBasicInfo, array('id' => $salaried->getId(), 'name' => ($salaried->getFirstName30004()." ".$salaried->getFamilyName30002())));
}
return $this->render('Index/index.html.twig', array('salariedList' => $salariedBasicInfo));
}
/**
* @Route("/cgu", name="cgu", options = { "expose" = true }, methods={"GET","HEAD"})
* @return Response
*/
public function cgu() : Response
{
return $this->render('CGU/cgu.html.twig', array());
}
/**
* @Route("/task-list", name="task_list", options = { "expose" = true }, methods={"GET","HEAD"})
*/
public function editionList() : Response
{
return $this->render('Task/taskList.html.twig', array());
}
}