public function __construct() { $this->_http = App_Http::getInstance(); $this->_view = App_View::getInstance(); $this->_view->js = array(); $this->_view->css = array(); }
public static function redirect(array $params, $absolute = false) { $params['ctrl'] = isset($params['ctrl']) ? $params['ctrl'] : "index"; $params['act'] = isset($params['act']) ? $params['act'] : "index"; $module = App_Http::getInstance()->getModuleName(); $dir = BASE_DIRECTORY; $url = ''; if (!empty($dir)) { $url = $dir; } // $url .= strtolower($module); if ($params['ctrl'] == 'index' && $params['act'] == 'index') { } else { $url .= $params['ctrl']; $url .= '/' . $params['act']; } header('Location: ' . BASE_URL . $url); }
private function __construct() { $this->_session = App_Session::getInstance(); $this->_http = App_Http::getInstance(); }
private function __construct() { $this->_http = App_Http::getInstance(); $this->response = new stdClass(); // $this->csrf_token = App_CSRFUtil::getInstance()->getToken(true); }
public static function run() { self::initAutoLoad(); App_Config::getInstance(); try { $http = App_Http::getInstance(); // if($http->isXHR()){ // if(!App_CSRFUtil::getInstance()->isValid()){ // throw new Exception('Invalid token'); // } // } $className = 'App_Controller_' . $http->getModuleName() . '_' . $http->getControllerName(); if ($http->isAdminModule()) { $auth = App_Auth::getInstance()->getInstance(); if (!$auth->isAuthAction()) { $http->setModuleName("Admin")->setControllerName("Auth")->setActionName("login"); $className = 'App_Controller_' . $http->getModuleName() . '_' . $http->getControllerName(); } } $ctrl = new $className(); $ctrl->dispatch($http->getActionName() . 'Action'); } catch (App_Request_Params_Exceptions $e) { die($e->getMessage()); } catch (App_Mysql_Exceptions $e) { die($e->getMessage()); } catch (Exception $e) { die($e->getMessage()); } }