src/Controller/MembersController.php line 24

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