本文整理汇总了PHP中yii\web\Session::remove方法的典型用法代码示例。如果您正苦于以下问题:PHP Session::remove方法的具体用法?PHP Session::remove怎么用?PHP Session::remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\web\Session
的用法示例。
在下文中一共展示了Session::remove方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionLogout
public function actionLogout()
{
if (isset($_SESSION['userid'])) {
$session = new Session();
$session->remove('userid');
$session->remove('username');
$session->remove('groupid');
}
return $this->redirect('index.php?r=login');
}
示例2: actionLogout
public function actionLogout()
{
Yii::$app->user->logout();
if (isset($_SESSION['userid'])) {
$session = new Session();
$session->remove('userid');
$session->remove('username');
$session->remove('groupid');
}
$model = new LoginForm();
return $this->redirect('index.php?r=login/login');
}
示例3: actionShowjob
public function actionShowjob()
{
$session = new Session();
$session->open();
$model = Alljobs::find()->where(['recid' => $session['recid']])->all();
if ($model) {
$session->remove('recid');
$this->layout = 'mylayout';
return $this->render('index', ['model' => $model]);
}
}
示例4: actionAsistencia
public function actionAsistencia()
{
$session = new Session();
if (!isset($session['comision'])) {
$this->redirect(["clase/crear"]);
}
$msg = null;
if (isset($_REQUEST['asistencia'])) {
$si = [];
$no = [];
$fecha = $session['fecha'];
$observacion = $session['observacion'];
$id = $session['comision'];
$datos = $_REQUEST['asistencia'];
$n = count($datos);
for ($i = 0; $i < $n; $i++) {
$pos = strpos($datos[$i], "si");
if ($pos !== false) {
$array = explode("-", $datos[$i], 2);
$si[] = $array[1];
} else {
$array = explode("-", $datos[$i], 2);
$no[] = $array[1];
}
}
$sql1 = "insert into clase (fecha,observaciones,id_comision) value ('{$fecha}','{$observacion}','{$id}')";
$connection = \Yii::$app->db;
$transaction = $connection->beginTransaction();
try {
$connection->createCommand($sql1)->execute();
$id = Yii::$app->db->getLastInsertID('clase');
foreach ($si as $val) {
$nota = $_REQUEST[$val];
$connection->createCommand("insert into asistencia (id_clase,dni,asistencia,nota) value ('{$id}','{$val}',1,'{$nota}')")->execute();
}
foreach ($no as $val) {
$connection->createCommand("insert into asistencia (id_clase,dni,asistencia,nota) value ('{$id}','{$val}',0,10)")->execute();
}
$transaction->commit();
$session->remove('fecha');
$session->remove('comision');
$session->remove('observaciones');
$msg = "asistencia registrada con ecxito";
$this->redirect(["clase/crear"]);
} catch (\Exception $e) {
//$msg = "problemas al registrar asistencia";
throw $e;
}
}
$comision = $session['comision'];
$sql = "SELECT persona.nombre, persona.dni from persona,deportista_categoria,comision " . "WHERE comision.id_comision='{$comision}' and comision.id_categoria=deportista_categoria.id_categoria and " . "deportista_categoria.dni=persona.dni ";
$alumnos = Yii::$app->db->createCommand($sql)->queryAll();
$i = 1;
$nota = null;
$model = $alumnos;
return $this->render("asistencia", ['model' => $model, 'msg' => $msg]);
}
示例5: isset
Yii::$app->user->can('Administrator') ? [['label' => 'Настройки', 'url' => ['Fregat/fregat/config']]] : []
),
]);
NavBar::end();
} */
?>
<?php
echo Breadcrumbs::widget(['links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [], 'homeLink' => ['url' => Yii::$app->homeUrl, 'label' => '<span class="bc_lighter"></span><i class="glyphicon glyphicon-home"></i>', 'encode' => false]]);
?>
<?php
if (!isset($this->params['breadcrumbs'])) {
$session = new Session();
$session->open();
$session->remove('breadcrumbs');
$session->close();
}
?>
<?php
echo $content;
?>
</div>
<div class="buttonside" id="scrollupbutton" style="display: none;">
<span>ВВЕРХ</span>
</div>
<a class="buttonside" id="backbutton" href="<?php
echo Proc::GetPreviousURLBreadcrumbsFromSession() === Yii::$app->homeUrl ? '#' : Proc::GetPreviousURLBreadcrumbsFromSession();
?>
" style="display: none;">
示例6: GetMenuButtons
/**
* Формирует массив настроек для Nav::Widget(['items' => Proc::GetMenuButtons($this)]).
* @param View $View Текущее представление.
* @return array Массив конфигурации меню навигации.
*/
public static function GetMenuButtons($View)
{
$controller = Yii::$app->controller;
$default_controller = Yii::$app->defaultRoute;
$isHome = $controller->id === $default_controller && $controller->action->id === $controller->defaultAction ? true : false;
$urls = ['fregat_mainmenu' => 'Fregat/fregat/mainmenu', 'fregat_conf' => 'Fregat/fregat/config', 'config_conf' => 'Config/config/index', 'glauk_index' => 'Base/patient/glaukindex', 'glauk_conf' => 'Glauk/glaukuchet/config'];
$session = new Session();
$session->open();
foreach ($urls as $url) {
// Записываем в сессию url меню
if ($url === $View->context->module->requestedRoute) {
$session['currentmenuurl'] = $url;
break;
}
}
$result = [];
if (!$isHome) {
$menubuttons = isset($session['menubuttons']) ? $session['menubuttons'] : null;
switch ($menubuttons) {
case 'fregat':
$result = array_merge(Yii::$app->user->can('FregatUserPermission') ? [['label' => 'Основное меню', 'url' => [$urls['fregat_mainmenu']], 'options' => $session['currentmenuurl'] === $urls['fregat_mainmenu'] ? ['class' => 'active'] : []]] : [], Yii::$app->user->can('FregatUserPermission') ? [['label' => 'Настройки', 'url' => [$urls['fregat_conf']], 'options' => $session['currentmenuurl'] === $urls['fregat_conf'] ? ['class' => 'active'] : []]] : []);
break;
case 'config':
$result = array_merge(Yii::$app->user->can('UserEdit') || Yii::$app->user->can('RoleEdit') ? [['label' => 'Настройки портала', 'url' => [$urls['config_conf']], 'options' => $session['currentmenuurl'] === $urls['config_conf'] ? ['class' => 'active'] : []]] : []);
break;
case 'glauk':
$result = array_merge(Yii::$app->user->can('GlaukUserPermission') ? [['label' => 'Пациенты', 'url' => [$urls['glauk_index']], 'options' => $session['currentmenuurl'] === $urls['glauk_index'] ? ['class' => 'active'] : []]] : [], Yii::$app->user->can('GlaukOperatorPermission') ? [['label' => 'Настройки', 'url' => [$urls['glauk_conf']], 'options' => $session['currentmenuurl'] === $urls['glauk_conf'] ? ['class' => 'active'] : []]] : []);
break;
}
} else {
$session->remove('menubuttons');
$session->remove('currentmenuurl');
}
$session->close();
return $result;
}
示例7: reset
/**
* Resets the wizard by deleting the wizard session.
*/
public function reset()
{
$this->_session->remove($this->_branchKey);
$this->_session->remove($this->_stepsKey);
$this->_session->remove($this->_timeoutKey);
}