Skip to content

Commit

Permalink
✨ default values, PR by @teichsta
Browse files Browse the repository at this point in the history
closes #18

Signed-off-by: bnomei <[email protected]>
  • Loading branch information
bnomei committed Feb 23, 2023
1 parent 5a19249 commit 4cc9bae
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 160 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,17 @@ echo site()->env('ALGOLIA_APIKEY'); // 37e30ad867ff3a427317dcd1852abbd692b39ffc

See [config examples](https://github.com/bnomei/kirby3-dotenv/tree/master/tests/site/config) on how to use this plugin in combination with kirbys config files. Since v2 this plugin support Kirbys [Multi-environment setup](https://getkirby.com/docs/guide/configuration#multi-environment-setup) used to merging multiple config files.

## Default values

In case you want to provide a default value as fallback in case the environment variable is not set you can do that with the 2nd parameter in each helper function.

```php
// `true` as default value
echo env('ALGOLIA_ENABLED', true);
```

> Thanks for your PR @teichsta
## Settings

| bnomei.dotenv. | Default | Description |
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bnomei/kirby3-dotenv",
"type": "kirby-plugin",
"version": "2.1.1",
"version": "2.2.0",
"description": "Kirby 3 Plugin for environment variables from .env",
"license": "MIT",
"authors": [
Expand Down
Loading

0 comments on commit 4cc9bae

Please sign in to comment.