Beispiel #1
0
 public function getCity()
 {
     if ($this->id_city) {
         return FCity::findOne($this->id_city);
     } else {
         return false;
     }
 }
Beispiel #2
0
 public function getCityName()
 {
     if ($this->id_city) {
         $city = FCity::findOne($this->id_city);
         return $city->name;
     } else {
         return "Выбрать";
     }
 }
Beispiel #3
0
 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]);
 }