src/Controller/Receiver/CoachController.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Receiver;
  3. use App\Entity\Faq;
  4. use App\Entity\Deals;
  5. use Doctrine\ORM\EntityManagerInterface;
  6. use Symfony\Component\HttpFoundation\Response;
  7. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  8. class CoachController extends AbstractController
  9. {
  10.     protected $em;
  11.     public function __construct(EntityManagerInterface $entityManager)
  12.     {
  13.         $this->em $entityManager;
  14.     }
  15.     public function index(): Response
  16.     {
  17.         $faq $this->em->getRepository(Faq::class)->findBy(["statut"=>1], ["position"=>"ASC"]);
  18.         $deals $this->em->getRepository(Deals::class)->findBy(["statut"=> 1]);
  19.         return $this->render('receiver/coach/index.html.twig', [
  20.             'deals' => $deals,
  21.             'faq' => $faq
  22.         ]);
  23.     }
  24. }