Closed Abylaikhan closed 8 years ago
What's on line controllers\SiteController.php:28
?
Have you tried searching for that error? Take a look at this: http://stackoverflow.com/questions/32737621/yii2-error-occurs-while-throwing-notfoundexception
On 28 line this code:
throw new ForbiddenHttpException();
http://stackoverflow.com/questions/32737621/yii2-error-occurs-while-throwing-notfoundexception
i can not solve problem(
i have this error:
`An Error occurred while handling another error:
exception 'yii\web\NotFoundHttpException' with message 'The requested page does not exist.' in C:\OpenServer\domains\yii2adv\backend\controllers\SiteController.php:28
Stack trace:
Previous exception: exception 'yii\web\NotFoundHttpException' with message 'The requested page does not exist.' in C:\OpenServer\domains\yii2adv\backend\controllers\SiteController.php:28 Stack trace:
Looks like a routing/access-control issue. What url are you going to?
this url: http://yii2adv/backend/site/index when i logged in like user i have an error above.
I'm not quite sure what the issue is, but I think it's a conflict between your custom init()
check and the access rules in behaviors()
Simplest solution would be to take out the access rules in behaviors()
. There's no need for them if you always check for admin user anyway
You must add 'error' on actions
'rules' => [
[
'actions' => ['error', ...
I add to backend controller method init()
but it gave error like this: An Error occurred while handling another error: exception 'yii\web\ForbiddenHttpException' in C:\OpenServer\domains\yii2adv\backend\controllers\SiteController.php:28
How to solve it?