本文整理汇总了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]);
}
}
示例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());
}
}
示例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]);
}
}