yiisoft/composer-config-plugin

Using `params`, `constants` and `ENV` variables in `JSON` and `yml` files

Spell6inder opened this issue · 3 comments

Is it possible to add an example to the documentation?
If there is no such functionality, is it planned?

@hiqsol Is it supported?

No. It is not implemented.
But it can be added easily. The only difficult question is to decide substitution pattern to use:

  • $_ENV['name']
  • { $_ENV['name'] }
  • {{ $_ENV['name'] }}
  • % $_ENV['name'] %
  • other?

I think %$_ENV['name']% would be better.
It`s be like in Symfony.

## ...
twig:
    default_path: '%kernel.project_dir%/templates'
## ...
framework:
    secret: '%env(APP_SECRET)%'

I do not propose to copy full behavior. But in this case, the style will be equal and acquainted.