當我得到一個ForbiddenHttpException
它的白色文本只是醜陋的黑色。它不使用標準的漂亮Yii2錯誤從「視圖/網站/ error.php」在yii2中造型ForbiddenHttpException錯誤
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
配置有:
'errorHandler' => [
'errorAction' => 'site/error',
],
是否有可能樣式的所有Yii2錯誤看起來是一樣的?
我們展示您的SiteController行爲(你應該只是允許錯誤動作) – soju
你是對的@soju我是不允許'error'爲認證用戶... – keeg
@soju請把它放在答案中,以便我可以接受。 – keeg