/** * Get config object */ public static function getRoute() { if (!self::$container['route']) { self::$container['route'] = Route::getInstance(); } return self::$container['route']; }
/** * Route */ protected function route() { //remove url suffix $pathinfo = str_replace(KantFactory::getConfig()->get('url_suffix'), '', $this->parsePathinfo()); Route::import(KantFactory::getConfig()->get('route')); $dispath = Route::check($pathinfo); if ($dispath === false) { $dispath = Route::parseUrl($pathinfo); } self::$dispatch = $dispath; }
<?php use Kant\Route\Route; // Route::get("/a", function () { return "Welcome To Kant Framework V2.1"; });