src/Controller/DefaultController.php line 15

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 App\Repository\Pointage\HeureAgentRepository;
  6. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  7. class DefaultController extends AbstractController
  8. {
  9.     /**
  10.      * @Route("/", name="accueil")
  11.      */
  12.     public function index(HeureAgentRepository $heureAgentRepository): Response
  13.     {
  14.         $date = new \DateTime();
  15.         $date->setTimezone(new \DateTimeZone('Pacific/Chatham'));
  16.         $mois $date->format("m");
  17.         $annee $date->format("Y");
  18.         $heuresAgent $heureAgentRepository->getInformations(""$mois$annee);
  19.         return $this->render('main/index.html.twig', [
  20.             'heuresAgent' => $heuresAgent,
  21.             'mois' => $mois,
  22.             'annee' => $annee,
  23.         ]);
  24.     }
  25. }