uri, $routes)){ require $routes[$uri]; }else{ $this->abort(); } } /** * Method to handle HTTP errors * Default is 404 - Not Found */ public function abort($code = 404){ /** * Set the HTTP response code to the specified value. * Then include and execute the corresponding error view (e.g., "views/404.php") and Terminate the script execution */ http_response_code($code); require "views/{$code}.php"; die(); } } // $routes = [ // '/' => 'controllers/index.php', // '/about' => 'controllers/about.php', // '/contact' => 'controllers/contact.php', // ]; // $router = Router::routeToController($routes); ?>