src/Controller/ErrorController.php line 10
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
class ErrorController extends AbstractController
{
public function showException(FlattenException $exception): Response
{
if ($exception->getStatusCode() === 404) {
return $this->render('userForm/error404.html.twig');
}
// Gérer les autres erreurs (500, 403, etc.)
return $this->render('bundles/TwigBundle/Exception/error.html.twig', [
'exception' => $exception,
]);
}
}