public function __construct() { $this->view = View::getInstance(); $this->session = Session::getInstance(); $this->redirect = Redirect::getInstance(); $this->validation = Validation::getInstance(); $this->auth = Auth::getInstance(); }
private function __construct() { $this->viewPath = realpath(config("app.views_default_path")); $current_controller = FrontController::getInstance()->getRouter()->controller . 'Controller'; if (class_exists($current_controller)) { $reflection = new \ReflectionClass($current_controller); $view_path = $_SERVER['DOCUMENT_ROOT'] . "/../" . str_replace("\\", DIRECTORY_SEPARATOR, lcfirst($reflection->getNamespaceName())) . "/../views"; if (is_dir($view_path) && is_readable($view_path)) { $this->viewPath = realpath($view_path); } else { $this->viewPath = config("app.views_default_path"); } } $this->errors = Session::getInstance()->getSession()->withErrors; $this->success = Session::getInstance()->getSession()->withSuccess; $this->input = Session::getInstance()->getSession()->withInput; Session::getInstance()->getSession()->unsetKey('withErrors'); Session::getInstance()->getSession()->unsetKey('withSuccess'); Session::getInstance()->getSession()->unsetKey('withInput'); }
public function __construct() { $this->_session = Session::getInstance(); $this->_input = InputData::getInstance(); }
public function __destruct() { if (Session::getInstance()->getSession() != null && !headers_sent()) { Session::getInstance()->getSession()->saveSession(); } }
public function __construct() { $this->session = Session::getInstance()->getSession(); }
/** * @Authorized */ public function logout() { $this->sql("UPDATE users SET access_token= '' WHERE id = ?", [$this->user()->id]); Session::getInstance()->getSession()->unsetKey('user_token'); Redirect::to('/')->go(); }