/** * Creates a new City model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new City(); if ($model->load($_POST) && $model->save()) { return $this->redirect(Url::previous()); } else { $model->load($_GET); return $this->render('create', ['model' => $model]); } }