add company
This commit is contained in:
@ -68,7 +68,9 @@ class StatusController extends Controller
|
||||
$model = new Status();
|
||||
|
||||
if ($model->load(Yii::$app->request->post()) && $model->save()) {
|
||||
return $this->redirect(['view', 'id' => $model->id]);
|
||||
Yii::$app->session->addFlash('success', 'Статус добавлен');
|
||||
|
||||
return $this->redirect(['index']);
|
||||
}
|
||||
|
||||
return $this->render('create', [
|
||||
@ -88,7 +90,8 @@ class StatusController extends Controller
|
||||
$model = $this->findModel($id);
|
||||
|
||||
if ($model->load(Yii::$app->request->post()) && $model->save()) {
|
||||
return $this->redirect(['view', 'id' => $model->id]);
|
||||
Yii::$app->session->addFlash('success', 'Статус обновлен');
|
||||
return $this->redirect(['index']);
|
||||
}
|
||||
$model->use = ArrayHelper::getColumn(
|
||||
\common\models\UseStatus::find()->where(['status_id' => $model->id])->asArray()->all(),
|
||||
|
@ -12,11 +12,9 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="status-view">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<p>
|
||||
<?= Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a('Delete', ['delete', 'id' => $model->id], [
|
||||
<?= Html::a('Редактировать', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a('Удалить', ['delete', 'id' => $model->id], [
|
||||
'class' => 'btn btn-danger',
|
||||
'data' => [
|
||||
'confirm' => 'Are you sure you want to delete this item?',
|
||||
|
Reference in New Issue
Block a user