mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Referencing env vars in configs
As mentioned here: https://stackoverflow.com/a/53459699/2111274
This commit is contained in:
parent
1d9e40ba26
commit
0353b29652
@ -48,6 +48,17 @@ use SilverStripe\Core\Environment;
|
||||
Environment::setEnv('API_KEY', 'AABBCCDDEEFF012345');
|
||||
```
|
||||
|
||||
### Using environment variables in config
|
||||
|
||||
To use environment variables in `.yaml` configs you can reference them using backticks.
|
||||
|
||||
```yaml
|
||||
SilverStripe\Core\Injector\Injector:
|
||||
MyServiceClass:
|
||||
properties:
|
||||
MyProperty: '`ENV_VAR_HERE`'
|
||||
```
|
||||
|
||||
## Including an extra `.env` file
|
||||
|
||||
Sometimes it may be useful to include an extra `.env` file - on a shared local development environment where all
|
||||
|
Loading…
Reference in New Issue
Block a user