src/Controller/Front/LegalNoticeController.php line 24

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Front;
  3. use App\Entity\LegalNotice;
  4. use App\Service\AccessClientService;
  5. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  6. use Symfony\Component\HttpFoundation\Response;
  7. use Symfony\Component\Routing\Annotation\Route;
  8. use Doctrine\ORM\EntityManagerInterface;
  9. class LegalNoticeController extends AbstractController
  10. {
  11.     /**
  12.      * @Route("/legal-notice", name="app_front_legal_notice")
  13.      */
  14.     public function legalNotice(AccessClientService $accessClientServiceEntityManagerInterface $entityManager): Response
  15.     {
  16.         $accessClientService->handleAccessControl();
  17.         
  18.         $legalNotices $entityManager->getRepository(LegalNotice::class)->findBy([], ['id' => 'ASC']);
  19.         return $this->render('front/legal_notice/legal_notice.html.twig', [
  20.             'legalNotices' => $legalNotices
  21.         ]);
  22.     }
  23. }