/** * Creates a new TourField model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate($tour_id) { $model = new TourField(); $model->tour_id = $tour_id; if ($model->load(Yii::$app->request->post()) && $model->save()) { SortUtils::normalizeSort($model, ['tour_id' => $model->tour_id]); return $this->redirectToFieldList($model->tour_id); } else { return $this->render('create', ['model' => $model]); } }