G
G
Gleb Vas2018-05-12 00:00:30
Yii
Gleb Vas, 2018-05-12 00:00:30

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

2 answer(s)
A
Andrey Eskov, 2019-07-14
@taurus2790

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',
            ],
        ];
    }

M
Maxim Timofeev, 2018-05-12
@webinar

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 question

Ask a Question

731 491 924 answers to any question