src/Controller/MentionsLegalesController.php line 18
<?php
namespace App\Controller;
use App\Entity\MentionsLegales;
use App\Form\MentionsLegalesType;
use App\Repository\MentionsLegalesRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
#[Route('/mentions-legales')]
class MentionsLegalesController extends AbstractController
{
#[Route('/', name: 'app_mentions_legales_show', methods: ['GET'])]
public function show(MentionsLegalesRepository $mentionsLegaleRepo): Response
{
$mentionsLegaleArray = $mentionsLegaleRepo->findAll();
$mentionsLegale = "";
if (count($mentionsLegaleArray) > 0) {
$mentionsLegale = $mentionsLegaleArray[0];
}
return $this->render('mentions_legales/show.html.twig', [
'mentions_legale' => $mentionsLegale,
]);
}
}