diff --git a/Core/Route.php b/Core/Route.php index d98fd1c..8cf9590 100644 --- a/Core/Route.php +++ b/Core/Route.php @@ -151,6 +151,16 @@ return Route::$current; } + public static function Execute() + { + $route = Route::CheckCurrent(); + if($route === false) + { + Response::Code(404); + }; + $route->call(); + } + public static function from(...$args) { return new Route(...$args); @@ -173,6 +183,11 @@ { $this->match = null; } + public function call(...$args) + { + $callback = $this->callback; + $callback(...$args); + } public function Run() { $requestUrl = Request::$url; diff --git a/index.php b/index.php index 82b4225..dd5b058 100644 --- a/index.php +++ b/index.php @@ -1,2 +1,12 @@ "Bir hata oluştu !" + ]); + }); + + Route::Execute(); \ No newline at end of file