src/Controller/Front/FooterPagesController.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Front;
  3. use App\Entity\Page\{PageMenu};
  4. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  5. use Symfony\Component\HttpFoundation\{ResponseRequest};
  6. use Symfony\Component\Routing\Annotation\Route;
  7. use Doctrine\ORM\EntityManagerInterface;
  8. #[Route('/front/footer'name'app.footer.')]
  9. class FooterPagesController extends AbstractController
  10. {
  11.     #[Route('/'name'pages.list')]
  12.     public function list(Request $requestEntityManagerInterface $em): Response
  13.     {
  14.         $menus $em->createQueryBuilder()
  15.             ->select('menu')
  16.             ->from(Menu::class, 'menu')
  17.             ->leftJoin('menu.pages''pages''with''pages.actif = true')
  18.             ->leftJoin('pages.article''article')
  19.             ->getQuery()->getResult()
  20.         ;
  21.         return $this->render('front/footer_pages/list.html.twig', [
  22.             'menus' => $menus,
  23.         ]);
  24.     }
  25. }