From f6df29226eaad3c37245b8774de6639acf589b1d Mon Sep 17 00:00:00 2001 From: filippo.bertilotti <filippobertilotti@gmail.com> Date: Fri, 10 May 2024 11:23:50 +0200 Subject: [PATCH] refactor code index dispatcher (parte 64) --- index.php | 15 ++------------- 1 files changed, 2 insertions(+), 13 deletions(-) diff --git a/index.php b/index.php index 8ba4394..9ebc44a 100644 --- a/index.php +++ b/index.php @@ -16,18 +16,7 @@ $router->add("/", ["controller" => "home", "action" => "index"]); $router->add("/{controller}/{action}"); -$params = $router->match($path); - -if($params === false) { - exit("No routes matched"); -} - -$controller = "App\Controllers\\" . ucwords($params["controller"]); -$action = $params["action"]; - -$controller_object = new $controller; - -$controller_object->$action(); - $dispatcher = new Framework\Dispatcher($router); + +$dispatcher->handle($path); \ No newline at end of file -- Gitblit v1.8.0