Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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();

```