public function actionCreate()
    {
        $model = new AuthItemModel();
        $model->type = $this->type;

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            Yii::$app->session->setFlash('success', Yii::t('yii2mod.rbac', 'Item has been saved.'));

            return $this->redirect(['view', 'id' => $model->name]);
        }

        return $this->render('create', ['model' => $model]);
    }
public function actionCreate()
    {
        $model = new AuthItemModel();
        $model->type = $this->type;

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            Yii::$app->session->setFlash('success', Yii::t('yii2mod.rbac', 'Item has been saved.'));

            return $this->redirect(['view', 'id' => $model->name]);
        }

        return $this->render('create', ['model' => $model]);
    }
public function actionCreate ( ) { $ model = new AuthItemModel ( ) ; $ model -> type = $ this -> type ; if ( $ model -> load ( Yii :: $ app -> request -> post ( ) ) && $ model -> save ( ) ) { Yii :: $ app -> session -> setFlash ( 'success' , Yii :: t ( 'yii2mod.rbac' , 'Item has been saved.' ) ) ; return $ this -> redirect ( [ 'view' , 'id' => $ model -> name ] ) ; } return $ this -> render ( 'create' , [ 'model' => $ model ] ) ; }
Creates a new AuthItem model.

If creation is successful, the browser will be redirected to the 'view' page.

@return mixed
Creates a new AuthItem model .