public static function initRoute($route, $classAction) { $init = new Route(); $init->url = $init->getURL(); //echo count(self::$register); /*for($i=0; $i < count($register); $i++) { $key = array_search($init->url, self::$register[$i]); } echo "ME: -->"; var_dump(self::$register);*/ $init->route = $route; //$init->className = $classAction; $init->slashCount = $init->getParamsAndSlashesCount('slash'); $init->slashCountUrl = $init->getParamsAndSlashesCount('slash_url'); $init->paramsCount = $init->getParamsAndSlashesCount(); $init->generedRoute = $init->getGeneredUrl(); $init->params = $init->getParams(); $init->paramsCountRoute = $init->getParamsNameFromRoute(true); /*$regiter = new RouteRegister(); $register->url = $init->url; $regiter->route = $init->route; $regiter->classAction = $classAction;*/ return $init; }
public function get($route, $classAction) { echo "dfsd " . $classAction; $init = new RouteRegister(); $init->route = $route; $init->classAction = $classAction; $url = $_SERVER['REQUEST_URI']; $objRoute = new Route(); $objRoute->route = $this->route; $objRoute->url = $url; $generedUrl = $objRoute->getGeneredUrl(); //$route = '/ma'; //echo "THIS: " . $this->classAction; if ($url == $generedUrl) { Route::get($route, $classAction); } }