/** * [set description] * @param [type] $value [description] * @param array $params [description] */ public static function set($value, array $params) { $list = array('Errors', 'App', 'Loader', 'Dispatcher', 'Database', 'Routes'); if (in_array($value, $list)) { switch ($value) { case 'Dispatcher': require_once SYSPATH . 'routing/Dispatcher.php'; Dispatcher::configure($params); break; case 'Loader': require_once SYSPATH . 'loader/Loader.php'; Loader::configure($params); break; case 'App': require_once SYSPATH . 'config/App.php'; App::configure($params); break; case 'Errors': require_once SYSPATH . 'errors/Errors.php'; Errors::configure($params); break; case 'Routes': require_once SYSPATH . 'routing/Routes.php'; $r = new Routes(); $r->setCustomRoutes($params); break; case 'Database': // Database::configure( $params ); break; } } else { exit('Error'); } }
/** * [checkRouting description] * @return [type] [description] */ public function checkRouting() { $route = Routes::getRoutes(); if (count($route) > 0) { extract($route); if (strtolower($this->controller) === strtolower($controller) and strtolower($this->method) === strtolower($method)) { $n = explode('/', $redirect); $this->controller = $n[0]; $this->method = $n[1]; } } }