yii2: Unable to resolve the request translation

Hi,

If possible can you include the message “Unable to resolve the request” into the yii.php so this error message can be translated.


//in module php
throw new InvalidRouteException('Unable to resolve the request "' . ($id === '' ? $route : $id . '/' . $route) . '".');

//in controller.php

 throw new InvalidRouteException('Unable to resolve the request: ' . $this->getUniqueId() . '/' . $id);


About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 18 (10 by maintainers)

Most upvoted comments

I did this because I want to do it with my controller but exception messages not affected with my controller. Is it normal ?? My error.htm loaded succesfully but without loading the error controller. Because I have deleted the error function and it still works and show the error page : ))


'errorHandler' => [
            'errorAction' => 'site/error',
        ],

in site controller

/* I added this method as per documentation */

    public function actions()
    {
        return [
            'error' => [
                'class' => 'yii\web\ErrorAction',
                'view'=>'@app/views/site/error.htm',
            ],     
        ];
    }

 public function actionError()
    {

        if(404==Yii::$app->errorHandler->error->code)
        {
            $message = 'Translated message';
        }
        else
        {
            $message = Yii::$app->errorHandler->error;
        }

        return $this->render('error.htm',[
            'message' => $message,
        ]

        );
  }