Showing posts with label Custom symfony error pages for 404 and 500 errors. Show all posts
Showing posts with label Custom symfony error pages for 404 and 500 errors. Show all posts

Custom symfony error pages for 404 and 500 errors

500 error page
- Since symfony 1.2 your error page must be stored as error.html.php in the folder /config/errors/
- Default file:/lib/vendor/symfony/lib/exception/data/error.html.php
Available variables:  (một số biến được dùng trong file error)
- $exception: The exception.
- $code: The status code. Defaults to 500 but might have been replaced by $response->getStatusCode().
- $text: The status text. Defaults to “Internal server error” but might have been replaced by $response->getStatusText().
- $format: The request format. Defaults to “html” but might have been replaced by $response->getRequestFormat().