src/Controller/MentionsLegalesController.php line 18

  1. <?php
  2. namespace App\Controller;
  3. use App\Entity\MentionsLegales;
  4. use App\Form\MentionsLegalesType;
  5. use App\Repository\MentionsLegalesRepository;
  6. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  7. use Symfony\Component\HttpFoundation\Request;
  8. use Symfony\Component\HttpFoundation\Response;
  9. use Symfony\Component\Routing\Annotation\Route;
  10. #[Route('/mentions-legales')]
  11. class MentionsLegalesController extends AbstractController
  12. {
  13.  
  14.     #[Route('/'name'app_mentions_legales_show'methods: ['GET'])]
  15.     public function show(MentionsLegalesRepository $mentionsLegaleRepo): Response
  16.     {
  17.         $mentionsLegaleArray $mentionsLegaleRepo->findAll();
  18.         $mentionsLegale "";
  19.         if (count($mentionsLegaleArray) > 0) {
  20.             $mentionsLegale $mentionsLegaleArray[0];
  21.         }
  22.         return $this->render('mentions_legales/show.html.twig', [
  23.             'mentions_legale' => $mentionsLegale,
  24.         ]);
  25.     }
  26. }