Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ckamte/slim-framework-4-custom-error-handler
Slim Framework 4 custom error page with bootstrap 5
https://github.com/ckamte/slim-framework-4-custom-error-handler
error-handling php slim-framework slim4
Last synced: about 1 month ago
JSON representation
Slim Framework 4 custom error page with bootstrap 5
- Host: GitHub
- URL: https://github.com/ckamte/slim-framework-4-custom-error-handler
- Owner: ckamte
- License: mit
- Created: 2023-03-18T13:04:26.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-19T07:30:50.000Z (almost 2 years ago)
- Last Synced: 2024-02-28T16:04:09.440Z (10 months ago)
- Topics: error-handling, php, slim-framework, slim4
- Language: PHP
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Custom Error Handler for Slim Framework 4
Using twig-view (as view) and monolog (as logger) containers.
# usage
```php
addRoutingMiddleware();// Register Error Middleware
$displayErrorDetails = true; //from your settings
$errorMiddleware = $app->addErrorMiddleware($displayErrorDetails, true, true);// Register Error Handler
$errorHandler = new ViewErrorHandler($app);
$errorMiddleware->setDefaultErrorHandler($errorHandler);// Run Application
$app->run();```