public function actionDescription() { if (Yii::$app->user->isGuest) { $this->redirect(Yii::$app->user->loginUrl); } $model = BContacts::find()->where(['site' => 1])->one(); if (!$model) { $model = new BContacts(); $model->site = 1; } if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->render('description', ['model' => $model, 'success' => true]); } return $this->render('description', ['model' => $model]); }