public static function init() { require APP_PATH . 'config/routes.php'; $request_uri = explode('/', $_SERVER['REQUEST_URI']); $requestAux = explode('@', $routes[$request_uri[1]]); self::$_controller = $requestAux[0]; self::$_action = $requestAux[1]; }
/** * Parse a URI and load it as the current request. * * @param uri The URI to load. */ public static function load($uri) { $route = self::parse($uri); self::$context = is_null($route['context']) ? Config::get('xoket.default_context') : $route['context']; self::$controller = is_null($route['controller']) ? Config::get('xoket.default_controller') : $route['controller']; self::$method = $route['method']; self::$arguments = $route['arguments']; }
public static function init() { //Tratar requisição (endereço, post, get) Request_Core::init(); //Configurações //Config_Core::init(); $controller = Request_Core::getController(); $controller = new $controller(); $action = Request_Core::getAction(); $controller->{$action}(); }