public function getCity() { if ($this->id_city) { return FCity::findOne($this->id_city); } else { return false; } }
public function getCityName() { if ($this->id_city) { $city = FCity::findOne($this->id_city); return $city->name; } else { return "Выбрать"; } }
public function actionEditCity($id) { $model = FCity::findOne($id); if (Yii::$app->request->isPost) { $post = Yii::$app->request->post(); $model->load($post); if ($model->validate()) { $model->save(); $this->redirect(['geo/index-city', "id" => $model->id_region]); } } return $this->render('editCity', ['model' => $model]); }