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


PHP Proc::RemoveLastBreadcrumbsFromSession方法代码示例

本文整理汇总了PHP中app\func\Proc::RemoveLastBreadcrumbsFromSession方法的典型用法代码示例。如果您正苦于以下问题:PHP Proc::RemoveLastBreadcrumbsFromSession方法的具体用法?PHP Proc::RemoveLastBreadcrumbsFromSession怎么用?PHP Proc::RemoveLastBreadcrumbsFromSession使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\func\Proc的用法示例。


在下文中一共展示了Proc::RemoveLastBreadcrumbsFromSession方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionCreate

 public function actionCreate()
 {
     $model = new Grupa();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         Proc::RemoveLastBreadcrumbsFromSession();
         // Удаляем последнюю хлебную крошку из сессии (Создать меняется на Обновить)
         return $this->redirect(['update', 'id' => $model->grupa_id]);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }
开发者ID:vovancho,项目名称:yii2test,代码行数:11,代码来源:GrupaController.php

示例2: actionCreate

 public function actionCreate($patienttype)
 {
     $model = new Patient();
     $Fias = new Fias();
     $Fias->AOGUID = '0bf0f4ed-13f8-446e-82f6-325498808076';
     // Нижневартовск по умолчанию
     if ($Fias->load(Yii::$app->request->post())) {
         if (!empty($Fias->AOGUID)) {
             $Fias = Fias::findOne($Fias->AOGUID);
             if ($Fias->AOLEVEL > 4 && $Fias->AOLEVEL < 7) {
                 $model->id_fias = $Fias->AOGUID;
                 $model->scenario = 'nostreetrequired';
             } else {
                 $model->scenario = 'streetrequired';
             }
         }
     }
     $Fias->scenario = 'citychooserequired';
     // Адрес обязателен
     $dopparams = ['dopparams' => []];
     if ($patienttype === 'glauk') {
         $Glaukuchet = new Glaukuchet();
         $Glaukuchet->glaukuchet_lastvisit = date('Y-m-d');
         $Glaukuchet->scenario = 'forvalidatewithout_id_patient';
         $dopparams['dopparams']['Glaukuchet'] = $Glaukuchet;
     }
     $transaction = Yii::$app->db->beginTransaction();
     try {
         if ($patienttype === 'glauk' && $model->load(Yii::$app->request->post()) && $Glaukuchet->load(Yii::$app->request->post()) && Model::validateMultiple([$model, $Glaukuchet, $Fias])) {
             $model->save(false);
             $Glaukuchet->id_patient = $model->primaryKey;
             $Glaukuchet->save(false);
             Proc::RemoveLastBreadcrumbsFromSession();
             // Удаляем последнюю хлебную крошку из сессии (Создать меняется на Обновить)
             $transaction->commit();
             return $this->redirect(['update', 'id' => $model->patient_id, 'patienttype' => $patienttype]);
         } else {
             // Откатываем транзакцию
             $transaction->rollBack();
             return $this->render('create', array_merge(['model' => $model, 'Fias' => $Fias, 'patienttype' => $patienttype], $dopparams));
         }
     } catch (Exception $e) {
         $transaction->rollBack();
         throw new Exception($e->getMessage());
     }
 }
开发者ID:vovancho,项目名称:yii2test,代码行数:46,代码来源:PatientController.php

示例3: actionCreate

 public function actionCreate()
 {
     $model = new Material();
     if (isset($model->scenarios()['prihod'])) {
         $model->scenario = 'prihod';
     }
     $model->material_importdo = 1;
     $Mattraffic = new Mattraffic();
     if ($model->load(Yii::$app->request->post())) {
         if (empty($model->material_name1c)) {
             $model->material_name1c = $model->material_name;
         }
         if ($model->material_tip == 1) {
             $model->material_number = 1;
         }
         if ($model->save()) {
             $Mattraffic->id_material = empty($Mattraffic->id_material) ? $model->material_id : $Mattraffic->id_material;
             $Mattraffic->mattraffic_number = empty($Mattraffic->mattraffic_number) ? $model->material_number : $Mattraffic->mattraffic_number;
             $Mattraffic->mattraffic_tip = empty($Mattraffic->mattraffic_tip) ? 1 : $Mattraffic->mattraffic_tip;
             if ($Mattraffic->load(Yii::$app->request->post()) && $Mattraffic->save()) {
                 Proc::RemoveLastBreadcrumbsFromSession();
                 // Удаляем последнюю хлебную крошку из сессии (Создать меняется на Обновить)
                 return $this->redirect(['update', 'id' => $model->primaryKey]);
             } else {
                 return $this->render('create', ['model' => $model, 'Mattraffic' => $Mattraffic]);
             }
         } else {
             return $this->render('create', ['model' => $model, 'Mattraffic' => $Mattraffic]);
         }
     } else {
         $model->material_number = empty($model->material_number) ? 1 : $model->material_number;
         $model->material_price = empty($model->material_price) ? 1 : $model->material_price;
         $model->material_tip = empty($model->material_tip) ? 1 : $model->material_tip;
         $model->id_matvid = empty($model->id_matvid) ? 1 : $model->id_matvid;
         $model->id_izmer = empty($model->id_izmer) ? 1 : $model->id_izmer;
         $Mattraffic->mattraffic_date = empty($Mattraffic->mattraffic_date) ? date('Y-m-d') : $Mattraffic->mattraffic_date;
         return $this->render('create', ['model' => $model, 'Mattraffic' => $Mattraffic]);
     }
 }
开发者ID:vovancho,项目名称:yii2test,代码行数:39,代码来源:MaterialController.php


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