app-zap / PHPFramework

A lightweight PHP framework as a composition of different good features and concepts of other frameworks intended for easy use and fast development
Other
4 stars 1 forks source link

Routing: Sexy solution to configure error pages #28

Closed smichaelsen closed 9 years ago

smichaelsen commented 9 years ago

If routing results in 404 other other errors you should be able to define error output behaviour in an elegant way.

smichaelsen commented 9 years ago

Idea: use integers as keys in the routing array to indicate HTTP Status codes:

// ..
400 => 'bad request', // applied to HTTP code 400 and all 4xx error codes that are not explicitly defined
404 => 'not found', // applied to HTTP code 404
// ..