Ejemplo n.º 1
0
 /**
  * 添加角色
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new AuthItem();
     $model->type = AuthItem::TYPE_ROLE;
     if ($model->load(Yii::$app->request->post())) {
         if ($model->createRole()) {
             Yii::$app->session->setFlash('success', Yii::t('app', 'Create role success'));
             return $this->redirect('index');
         }
     }
     return $this->render('create', ['model' => $model]);
 }