I'm creating reusable Symfony bundle that has many configuration parameters and I need them in framework and twig bundles also.
Here is a working example of how my config currently looks (app/config/config.yml):
# my bundle parameters
parameters:
locales_active:
- en_US
- de_DE
locale_default: en_US
locale_fallback: de_DE
google_maps_api_key: some_value
google_translate_api_key: some_value
# framework parameters
framework:
translator: { fallbacks: ['%locale_fallback%']
default_locale: "%locale_default%"
# twig parameters
twig:
globals:
locales_active: '%locales_active%'
google_maps_api_key: '%google_maps_api_key%'
google_translate_api_key: '%google_translate_api_key%'
This approach works, but I want to be as simple as possible to install this bundle (here is only a small part of parameters, actually there are many more).
What I would like to do is:
1) only create this part of code in config.yml (move bundle parameters to it's own namespace from global "parameters:"):
acme_core:
locales_active:
- en_US
- de_DE
locale_default: en_US
locale_fallback: de_DE
google_maps_api_key: some_value
google_translate_api_key: some_value
2) assign these parameters to framework or twig dynamically without editing configuration file. For example, maybe in DependencyInjection/Configuration.php if that is possible.
How this could be achieved?