ProBundle/Controller/HomeController.php line 14

Open in your IDE?
  1. <?php
  2. namespace ProBundle\Controller;
  3. use App\Entity\PrestationEntreprise;
  4. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  5. use Symfony\Component\HttpFoundation\Response;
  6. use Symfony\Component\Routing\Annotation\Route;
  7. use Doctrine\ORM\EntityManagerInterface;
  8. class HomeController extends AbstractController
  9. {
  10.     #[Route(''name'pro_home_index')]
  11.     public function index(EntityManagerInterface $entityManager)
  12.     {
  13.           //On récupère l'objet prestationEntreprise isActive true
  14.           $prestations $entityManager->getRepository(PrestationEntreprise::class)
  15.           ->findByIsActive(true);
  16.         return $this->render('@probundle/probundle/home/index.html.twig', [
  17.             'prestations' => $prestations
  18.         ]);
  19.     }
  20. }