src/Controller/FrontController.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Repository\ConfigurationRepository;
  4. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  5. use Symfony\Component\HttpFoundation\Response;
  6. use Symfony\Component\Routing\Annotation\Route;
  7. use App\Entity\Certification;
  8. use App\Repository\AproposRepository;
  9. use Doctrine\ORM\EntityManagerInterface;
  10. class FrontController extends AbstractController
  11. {
  12.     #[Route('/'name'app_front')]
  13.     public function index(ConfigurationRepository $configurationRepository,EntityManagerInterface $entityManager,AproposRepository $aproposRepository): Response
  14.     {
  15.         
  16.         $config$configurationRepository->find(1);
  17.         $apropos$aproposRepository->find(1);
  18.         return $this->render('baseFront.html.twig', [
  19.             'controller_name' => 'FrontController',
  20.             'config'=>$config,
  21.             'certifications' => $entityManager->getRepository(Certification::class)->findAll(),
  22.             'encadrements' => $entityManager->getRepository(\App\Entity\Encadrement::class)->findAll(),
  23.             'temoignages' => $entityManager->getRepository(\App\Entity\Temoignage::class)->findAll(),
  24.             'apropos'=>$apropos,
  25.             'skills' => $entityManager->getRepository(\App\Entity\Skills::class)->findAll(),
  26.             'experiences' => $entityManager->getRepository(\App\Entity\Experience::class)->findBy([], ['id' => 'DESC']),
  27.             'educations' => $entityManager->getRepository(\App\Entity\Education::class)->findBy([], ['id' => 'DESC']),
  28.             'publications' => $entityManager->getRepository(\App\Entity\Publication::class)->findBy([], ['year' => 'DESC']),
  29.         ]);
  30.     }
  31. }