@@ -68,7 +68,7 @@ |
||
68 | 68 | 'range' => array_keys(Yii::$app->authManager->getRules()), |
69 | 69 | 'message' => Yii::t('yuncms', 'Rule not exists.')], |
70 | 70 | [['name', 'type'], 'required'], |
71 | - [['name'], 'unique', 'when' => function () { |
|
71 | + [['name'], 'unique', 'when' => function() { |
|
72 | 72 | return $this->isNewRecord || ($this->_item->name != $this->name); |
73 | 73 | }], |
74 | 74 | [['type'], 'integer'], |
@@ -79,7 +79,7 @@ |
||
79 | 79 | $model = new AdminAuthItem(null); |
80 | 80 | $model->type = $this->type; |
81 | 81 | if ($model->load(Yii::$app->getRequest()->post()) && $model->save()) { |
82 | - Yii::$app->getSession()->setFlash('success', Yii::t('yuncms','Create success.')); |
|
82 | + Yii::$app->getSession()->setFlash('success', Yii::t('yuncms', 'Create success.')); |
|
83 | 83 | return $this->redirect(['view', 'id' => $model->name]); |
84 | 84 | } else { |
85 | 85 | return $this->render('create', ['model' => $model]); |