We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For example:
<?php $app->error(404, function() { return array(404, 'Page not found'); });
Which can then be called inside a route:
<?php $app->get('/', function($app) { return $app->error(404); });
The text was updated successfully, but these errors were encountered:
An alternative is to provide implement this as a filter that checks the status code of the response. Example:
<?php use Elmer\Filters\ErrorHandler; $errors = new ErrorHandler; $errors[404] = function($app) { return array(404, 'Custom error message'); }); $app->filter($errors);
Routes return a status code with no knowledge of the error handler filter
<?php $routes->get('/', function($app) { return 404; });
Sorry, something went wrong.
No branches or pull requests
For example:
Which can then be called inside a route:
The text was updated successfully, but these errors were encountered: