From 3988f3eb48bafb36b370eecc75a87e804f57c09d Mon Sep 17 00:00:00 2001 From: polo Date: Sat, 6 Jun 2026 00:32:43 +0200 Subject: =?UTF-8?q?classe=20Router,=20flash=20errors=20r=C3=A9cup=C3=A9r?= =?UTF-8?q?=C3=A9es=20dans=20ViewDirector,=20exceptions=20bugg=C3=A9es,=20?= =?UTF-8?q?utilisation=20de=20Response=20=C3=A0=20certains=20endroits?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/index.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'public/index.php') diff --git a/public/index.php b/public/index.php index 591fff7..0f0a7e9 100644 --- a/public/index.php +++ b/public/index.php @@ -55,4 +55,18 @@ $request = Request::createFromGlobals(); /* -- partie 2: routage et contrôleurs -- */ define('CURRENT_PAGE', htmlspecialchars($request->query->get('page') ?? '')); -require '../src/service/router.php'; \ No newline at end of file + +Router::dispatch($request, $entityManager); + +// futur bon code après correction du routeur +/*try{ + $response = Router::dispatch($request, $entityManager); +} +catch(Throwable $e){ + $response = new JsonResponse([ + 'success' => false, + 'message' => 'Erreur interne' + ], 500); + // mieux utiliser une classe ErrorHandler qui gère les différents types d'erreur +} +$response->send();*/ \ No newline at end of file -- cgit v1.2.3