Skip to content

Commit 4cc9bae

Browse files
committed
✨ default values, PR by @teichsta
closes #18 Signed-off-by: bnomei <[email protected]>
1 parent 5a19249 commit 4cc9bae

File tree

6 files changed

+104
-160
lines changed

6 files changed

+104
-160
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,17 @@ echo site()->env('ALGOLIA_APIKEY'); // 37e30ad867ff3a427317dcd1852abbd692b39ffc
8888

8989
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.
9090

91+
## Default values
92+
93+
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.
94+
95+
```php
96+
// `true` as default value
97+
echo env('ALGOLIA_ENABLED', true);
98+
```
99+
100+
> Thanks for your PR @teichsta
101+
91102
## Settings
92103

93104
| bnomei.dotenv. | Default | Description |

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "bnomei/kirby3-dotenv",
33
"type": "kirby-plugin",
4-
"version": "2.1.1",
4+
"version": "2.2.0",
55
"description": "Kirby 3 Plugin for environment variables from .env",
66
"license": "MIT",
77
"authors": [

0 commit comments

Comments
 (0)