feat(Controller/composer): Ajoute robots.txt et modifie les routes de réservation.
```
This commit is contained in:
Serreau Jovann
2026-01-20 11:20:28 +01:00
parent efcf2e955c
commit 14aa985aad
5 changed files with 93 additions and 47 deletions

View File

@@ -10,6 +10,7 @@ use App\Logger\AppLogger;
use App\Service\ResetPassword\Event\ResetPasswordConfirmEvent;
use App\Service\ResetPassword\Event\ResetPasswordEvent;
use Doctrine\ORM\EntityManagerInterface;
use Fkrzski\RobotsTxt\RobotsTxt;
use KnpU\OAuth2ClientBundle\Client\ClientRegistry;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
@@ -25,42 +26,56 @@ use Symfony\Contracts\HttpClient\HttpClientInterface;
class ReserverController extends AbstractController
{
#[Route('/revervation', name: 'revervation')]
#[Route('/robots.txt', name: 'robots_txt', defaults: ['_format' => 'txt'])]
public function index(Request $request): Response
{
$robots = new RobotsTxt();
$robots->disallow('/signature');
$robots->disallow('/payment');
$robots->crawlDelay(60);
$robots->allow('/reservation');
$robots->sitemap($request->getSchemeAndHttpHost().$this->generateUrl('PrestaSitemapBundle_index',['_format' => 'xml']));
return new Response($robots->toString(),Response::HTTP_OK,[
'Content-Type' => 'text/plain'
]);
}
#[Route('/reservation', name: 'revervation')]
public function revervation()
{
return $this->render('revervation/home.twig');
}
#[Route('/revervation/contact', name: 'revervation_contact')]
#[Route('/reservation/contact', name: 'revervation_contact')]
public function revervationContact()
{
return $this->render('revervation/home.twig');
}
#[Route('/revervation/recherche', name: 'reservation_search')]
#[Route('/reservation/recherche', name: 'reservation_search')]
public function recherche()
{
}
#[Route('/revervation/mentions-legal', name: 'revervation_mentions-legal')]
#[Route('/reservation/mentions-legal', name: 'revervation_mentions-legal')]
public function revervationLegal()
{
return $this->render('revervation/legal.twig');
}
#[Route('/revervation/rgpd', name: 'revervation_rgpd')]
#[Route('/reservation/rgpd', name: 'revervation_rgpd')]
public function revervationRgpd()
{
return $this->render('revervation/rgpd.twig');
}
#[Route('/revervation/cookies', name: 'revervation_cookies')]
#[Route('/reservation/cookies', name: 'revervation_cookies')]
public function revervationCookies()
{
return $this->render('revervation/cookies.twig');
}
#[Route('/revervation/cgv', name: 'revervation_cgv')]
#[Route('/reservation/cgv', name: 'revervation_cgv')]
public function revervationCgv()
{
return $this->render('revervation/cgv.twig');
}
#[Route('/revervation/hosting', name: 'revervation_hosting')]
#[Route('/reservation/hosting', name: 'revervation_hosting')]
public function revervationHosting()
{
return $this->render('revervation/hosting.twig');