Skip to content

Commit

Permalink
📝 Add more information about settings
Browse files Browse the repository at this point in the history
  • Loading branch information
jenssegers committed Dec 23, 2018
1 parent 4624791 commit 165d061
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Expand Up @@ -76,6 +76,24 @@ $app->getContainer()->addServiceProvider(\Acme\ServiceProvider\SomeServiceProvid

Read more about service providers [here](https://container.thephpleague.com/3.x/service-providers/).

## Settings

You can access Slim's internal configuration through the `settings` key on the container:

```php
$app = new \Jenssegers\Lean\App();

$app->getContainer()->get('settings')['displayErrorDetails'] = true;
```

Alternatively, an alias is registered that allows a bit more fluent way of working with settings:

```php
$app = new \Jenssegers\Lean\App();

$app->getContainer()->get(\Slim\Settings::class)->set('displayErrorDetails', true);
```

## Error Handlers

By default, Lean uses Slim's error handlers. There are different ways to implement an error handler for Slim, read more about them [here](https://www.slimframework.com/docs/v3/handlers/error.html).
Expand Down

0 comments on commit 165d061

Please sign in to comment.