✨ feat(order): Ajoute les pages mentions légales et RGPD
Ajoute les templates et les routes pour afficher les mentions légales et la politique de confidentialité (RGPD).
This commit is contained in:
@@ -62,7 +62,7 @@ class HomeController extends AbstractController
|
||||
#[Route('/commande/legal',name: 'commande_legal')]
|
||||
public function legal(): Response
|
||||
{
|
||||
return $this->render('order/display.twig',[
|
||||
return $this->render('order/legal.twig',[
|
||||
'formules' => self::formules,
|
||||
]);
|
||||
}
|
||||
@@ -70,7 +70,7 @@ class HomeController extends AbstractController
|
||||
#[Route('/commande/rgpd',name: 'commande_rgpd')]
|
||||
public function rgpd(): Response
|
||||
{
|
||||
return $this->render('order/display.twig',[
|
||||
return $this->render('order/rgpd.twig',[
|
||||
'formules' => self::formules,
|
||||
]);
|
||||
}
|
||||
|
||||
31
src/EventListener/OrderSubscriber.php
Normal file
31
src/EventListener/OrderSubscriber.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\EventListener;
|
||||
|
||||
use Presta\SitemapBundle\Event\SitemapPopulateEvent;
|
||||
use Presta\SitemapBundle\Sitemap\Url\UrlConcrete;
|
||||
use Symfony\Component\EventDispatcher\Attribute\AsEventListener;
|
||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||
use Symfony\Component\HttpKernel\Event\RequestEvent;
|
||||
use Symfony\Component\HttpKernel\KernelEvents;
|
||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||
#[AsEventListener(event: KernelEvents::REQUEST,method: 'onKernelRequest')]
|
||||
class OrderSubscriber
|
||||
{
|
||||
public function __construct(private readonly UrlGeneratorInterface $urlGenerator)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function onKernelRequest(RequestEvent $event): void
|
||||
{
|
||||
$host = $event->getRequest()->getHost();
|
||||
$path = $event->getRequest()->getPathInfo();
|
||||
if($host == "commande.esy-web.fr" && !str_contains($path,"/commande")) {
|
||||
$redirect = new RedirectResponse($this->urlGenerator->generate('commande'));
|
||||
$event->setResponse($redirect);
|
||||
}
|
||||
}
|
||||
}
|
||||
10
templates/order/legal.twig
Normal file
10
templates/order/legal.twig
Normal file
File diff suppressed because one or more lines are too long
10
templates/order/rgpd.twig
Normal file
10
templates/order/rgpd.twig
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user