<?php
namespace App\Controller;
use App\Repository\ConfigurationRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use App\Entity\Certification;
use App\Repository\AproposRepository;
use Doctrine\ORM\EntityManagerInterface;
class FrontController extends AbstractController
{
#[Route('/', name: 'app_front')]
public function index(ConfigurationRepository $configurationRepository,EntityManagerInterface $entityManager,AproposRepository $aproposRepository): Response
{
$config= $configurationRepository->find(1);
$apropos= $aproposRepository->find(1);
return $this->render('baseFront.html.twig', [
'controller_name' => 'FrontController',
'config'=>$config,
'certifications' => $entityManager->getRepository(Certification::class)->findAll(),
'encadrements' => $entityManager->getRepository(\App\Entity\Encadrement::class)->findAll(),
'temoignages' => $entityManager->getRepository(\App\Entity\Temoignage::class)->findAll(),
'apropos'=>$apropos,
'skills' => $entityManager->getRepository(\App\Entity\Skills::class)->findAll(),
'experiences' => $entityManager->getRepository(\App\Entity\Experience::class)->findBy([], ['id' => 'DESC']),
'educations' => $entityManager->getRepository(\App\Entity\Education::class)->findBy([], ['id' => 'DESC']),
'publications' => $entityManager->getRepository(\App\Entity\Publication::class)->findBy([], ['year' => 'DESC']),
]);
}
}