setBasePath($basePath); $sampleFormController = new SampleFormController(); $router->map("GET", "/", fn() => $sampleFormController->displayForm()); $router->map("POST", "/result", fn() => $sampleFormController->displayResults($_POST)); $match = $router->match(); if ($match == null) { // TODO redirect to a 404 not found page instead (issue #1) echo "page non trouvée"; header('HTTP/1.1 404 Not Found'); exit(1); } call_user_func($match['target']);