src/Controller/LegalsController.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Entity\Legal;
  4. use Doctrine\ORM\EntityManagerInterface;
  5. use Symfony\Component\HttpFoundation\Response;
  6. use Symfony\Component\Routing\Annotation\Route;
  7. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  8. class LegalsController extends AbstractController
  9. {
  10.     /**
  11.      * @Route("/legals", name="app_legals")
  12.      */
  13.     public function legals(EntityManagerInterface $entityManager): Response
  14.     {
  15.         $legals $entityManager->getRepository(Legal::class)->findAll();
  16.         return $this->render('legals/show_legals.html.twig', [
  17.             'legals' => $legals,
  18.         ]);
  19.     }
  20.                             
  21. }