/** * Creates a new Dict model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate($category) { $model = new Dict(); $model->category_id = $category; $model->sort_num = 100; $model->status = Constants::Status_Enable; if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['index', 'category' => $category]); } else { return $this->render('create', ['model' => $model]); } }