/** * */ public function init() { $this->session = Yii::app()->getSession(); if (null === $this->session->get($this->key)) { $this->session->add($this->key, []); } }
/** * */ public function init() { $this->session = Yii::app()->getSession(); $this->productRepository = Yii::app()->getComponent('productRepository'); if (null === $this->session->get($this->key)) { $this->session->add($this->key, []); } }
protected function preFilter($filterChain) { /** @var CHttpSession */ self::$session = Yii::app()->session; if (self::$session->get('appointmentBuilder')) { self::$current = self::$session->get('appointmentBuilder'); } return parent::preFilter($filterChain); }
public function filterEnforcelogin($filterChain) { $session = new CHttpSession(); $session->open(); $userSesion = $session->get('usuarioSesion'); if (empty($userSesion)) { $this->redirect("login.php"); } $filterChain->run(); }
public function verificarSessiousuario() { $session = new CHttpSession(); $session->open(); $userSesion = $session->get('usuarioSesion'); if (empty($userSesion)) { $RESP = FALSE; } else { $RESP = TRUE; } return $RESP; }
/** * This is the default 'index' action that is invoked * when an action is not explicitly requested by users. */ public function actionIndex() { $session = new CHttpSession(); $session->open(); $userSesion = $session->get('usuarioSesion'); if (empty($userSesion)) { $this->redirect("login.php"); } else { $this->render('index'); } // renders the view file 'protected/views/site/index.php' // using the default layout 'protected/views/layouts/main.php' }
/** * @return mixed|null */ public function get() { return $this->session->get($this->key); }