setBasePath($basePath); $sampleFormController = new SampleFormController(new FormResultGateway($pdo)); $router->map("GET", "/", fn() => $sampleFormController->displayForm()); $router->map("POST", "/submit", fn() => $sampleFormController->submitForm($_POST)); $match = $router->match(); if ($match == null) { // TODO redirect to a 404 not found page instead (issue #1) http_response_code(404); echo "Page non trouvée"; exit(1); } call_user_func($match['target']);