We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This issue has originally been reported by @timfayz at yiisoft/yii2#2503. Moved here by @cebe.
Hello, I can't access to message property of exception's object. Is in normal?
message
My simple code:
#SiteController.php #I changed errorHandler action to site/error in configurations. public function actionError() { $this->layout = 'container'; if (\Yii::$app->exception !== null) { return $this->render('error', ['exception' => \Yii::$app->exception]); } } public function actionPage($view = 'index') { try { return $this->render('site/page/'.$view); } catch (InvalidParamException $e) { throw new HttpException(404, 'Страница не найдена'); } }
When I go to nonexist page, I get the following:
yii\web\HttpException Object ( [statusCode] => 404 [message:protected] => Страница не найдена #custom message naturally inaccessible
It means that I can't insert $exception->message into view file.
$exception->message
The text was updated successfully, but these errors were encountered:
It's been a while... But is it really necessary @samdark? I think the link to PHP docs in inheritance section is enough.
Sorry, something went wrong.
Otherwise we need to discuss what's exactly needs to be done here.
arogachev
No branches or pull requests
This issue has originally been reported by @timfayz at yiisoft/yii2#2503.
Moved here by @cebe.
Hello, I can't access to
message
property of exception's object. Is in normal?My simple code:
When I go to nonexist page, I get the following:
It means that I can't insert
$exception->message
into view file.The text was updated successfully, but these errors were encountered: