Customizing error pages

Yussuf Khalil edited this page Dec 14, 2013 · 3 revisions

Since Pancake 1.1

In case you want more beautiful and customized error pages you may build an error page handler yourself and tell Pancake to use it. See the Pancak default handler for reference.

Pancake will give you the following PHP variables:


An instance of Pancake\HTTPRequest.


An instance of Pancake\invalidHTTPRequestException.

Set vhost.exceptionPageHandler to the path of the custom handler in order to enable it. Please note that the exception page handler script is executed without a real PHP SAPI. This basically means that calls to functions like header() or setcookie() will lead to a crash. However, via $requestObject you have direct access to the Pancake\HTTPRequest API.