本文整理汇总了PHP中CHttpSession::get方法的典型用法代码示例。如果您正苦于以下问题:PHP CHttpSession::get方法的具体用法?PHP CHttpSession::get怎么用?PHP CHttpSession::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CHttpSession
的用法示例。
在下文中一共展示了CHttpSession::get方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
*
*/
public function init()
{
$this->session = Yii::app()->getSession();
if (null === $this->session->get($this->key)) {
$this->session->add($this->key, []);
}
}
示例2: init
/**
*
*/
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, []);
}
}
示例3: preFilter
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);
}
示例4: filterEnforcelogin
public function filterEnforcelogin($filterChain)
{
$session = new CHttpSession();
$session->open();
$userSesion = $session->get('usuarioSesion');
if (empty($userSesion)) {
$this->redirect("login.php");
}
$filterChain->run();
}
示例5: verificarSessiousuario
public function verificarSessiousuario()
{
$session = new CHttpSession();
$session->open();
$userSesion = $session->get('usuarioSesion');
if (empty($userSesion)) {
$RESP = FALSE;
} else {
$RESP = TRUE;
}
return $RESP;
}
示例6: actionIndex
/**
* 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'
}
示例7: get
/**
* @return mixed|null
*/
public function get()
{
return $this->session->get($this->key);
}