bramus / router

A lightweight and simple object oriented PHP Router
MIT License
1.09k stars 245 forks source link

Support HTTP 405 response code #174

Open jtojnar opened 2 years ago

jtojnar commented 2 years ago

This will allow us to have code like this:

$router->set404(function($handledByOtherMethod) {
    if ($handledByOtherMethod) {
        header('HTTP/1.1 405 Method Not Allowed');
    } else {
        header('HTTP/1.1 404 Not Found');
    }
    // ... do something special here
});
oskarniziol commented 2 years ago

Good idea!