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