<?php
namespace App\Controller\Front;
use App\Entity\Page\{Page, Menu};
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\{Response, Request};
use Symfony\Component\Routing\Annotation\Route;
use Doctrine\ORM\EntityManagerInterface;
#[Route('/front/footer', name: 'app.footer.')]
class FooterPagesController extends AbstractController
{
#[Route('/', name: 'pages.list')]
public function list(Request $request, EntityManagerInterface $em): Response
{
$menus = $em->createQueryBuilder()
->select('menu')
->from(Menu::class, 'menu')
->leftJoin('menu.pages', 'pages', 'with', 'pages.actif = true')
->leftJoin('pages.article', 'article')
->getQuery()->getResult()
;
return $this->render('front/footer_pages/list.html.twig', [
'menus' => $menus,
]);
}
}