当前位置: 首页>>代码示例>>PHP>>正文


PHP Session::remove方法代码示例

本文整理汇总了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');
 }
开发者ID:nirantarnoy,项目名称:ST,代码行数:10,代码来源:LoginController.php

示例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');
 }
开发者ID:nirantarnoy,项目名称:paperless,代码行数:12,代码来源:LoginController.php

示例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]);
     }
 }
开发者ID:nirantarnoy,项目名称:paperless,代码行数:11,代码来源:JobpreviewController.php

示例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]);
 }
开发者ID:emiherber,项目名称:sgdcae,代码行数:57,代码来源:ClaseController1.php

示例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;">
开发者ID:vovancho,项目名称:yii2test,代码行数:31,代码来源:main.php

示例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;
 }
开发者ID:vovancho,项目名称:yii2test,代码行数:41,代码来源:Proc.php

示例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);
 }
开发者ID:yii-dream-team,项目名称:yii2-wizard-behavior,代码行数:9,代码来源:Behavior.php


注:本文中的yii\web\Session::remove方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。