Reputation: 4503
In Symfony 2 you can do the following to return a 404 page
throw $this->createNotFoundException('message');
I was assuming that status_text
in the error template would display the custom message, but that does not seem to be the case. How can you display the custom message?
Short question, but I dont think this needs more information? Feel free to ask!
Upvotes: 3
Views: 497
Reputation: 48487
Looking at the show
action of ExceptionController
you can access the exception inside twig:
{{ exception.message }}
status_text
and status_code
are related to the HTTP protocol. To customize the error page look at the official documentation.
Upvotes: 2