public function actionCreate($region_id) { $model = new Place(['location_id' => $region_id]); if ($model->load(Yii::$app->request->post())) { $response = $this->uploadGooglePlace($model); $model = $this->loadPlaceFromGoogle($model, $response); $model->save(); $this->populatePlaceCategory($model); return $this->redirect(['view', 'id' => $model->place_id]); } else { return $this->render('create', ['model' => $model]); } }