Answer the question
In order to leave comments, you need to log in
How to fix Unable to resolve the request: site/error error on yii2 basic?
Good afternoon. I am writing a website in YII2 basic. The admin is left. I decided to make it a separate module. Everything works but an error occurs when trying to submit the form. The content is as follows:
yii\base\InvalidRouteException: Unable to resolve the request: site/error in E:\servNew\OSPanel\domains\basic\vendor\yiisoft\yii2\base\Controller.php:128
If anyone knows a solution then I will be grateful.
Answer the question
In order to leave comments, you need to log in
Perhaps already and there is no need to answer, but suddenly someone will come in handy.
Perhaps the problem is that the controller does not know which action to send the error to.
To do this, you need to write in the controller
/**
* {@inheritdoc}
*/
public function actions()
{
return [
'error' => [
'class' => 'yii\web\ErrorAction',
],
];
}
look for a problem in routing. You had an error and were redirected to site/error to display it. Here you need to check if there is a physical site / error and check the config, in particular, the manager's url.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question