我已经实施了一组规则,但是当用户尝试访问受限区域时,我得到的是文本输出,而不是一个很好的 boostrap 警报。我怎样才能让它再次工作?
规则:
public function behaviors()
{
return [
'access' => [
'class' => AccessControl::className(),
'only' => ['index', 'view'],
'rules' => [
[
'roles' => ['@'],
'actions' => ['index', 'view'],
'allow' => true,
],
],
],
异常消息:
An Error occurred while handling another error:
exception 'yii\web\ForbiddenHttpException' with message 'You are not allowed to perform this action!.' in ###\vendor\yiisoft\yii2\filters\AccessControl.php:151
Stack trace:...