v2.4.0
Updated error
function to handle Not Found
errors better. Now, you can use Request
and Response
instances in Closure parameters:
$router->error(function(Request $request, Response $response) {
$response->setStatusCode(Response::HTTP_NOT_FOUND);
$response->setContent('Oops! Page not found!');
return $response;
});