<?php
namespace ProBundle\Controller;
use App\Entity\PrestationEntreprise;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Doctrine\ORM\EntityManagerInterface;
class HomeController extends AbstractController
{
#[Route('', name: 'pro_home_index')]
public function index(EntityManagerInterface $entityManager)
{
//On récupère l'objet prestationEntreprise isActive true
$prestations = $entityManager->getRepository(PrestationEntreprise::class)
->findByIsActive(true);
return $this->render('@probundle/probundle/home/index.html.twig', [
'prestations' => $prestations
]);
}
}