I'm using the following Symfony components:
"require": {
"symfony/dependency-injection": "~3.0",
"symfony/yaml": "~3.0",
"symfony/config": "~3.0",
"symfony/console": "~3.0",
"symfony/validator": "~3.0",
"symfony/event-dispatcher": "~3.0",
"guzzlehttp/guzzle": "~6.0",
"gedex/janrain-api": "~0.1",
"monolog/monolog": "~1.0"
},
I have a forms.yaml and services.yaml. Services config file has information about services to be loaded by DependencyInjection component. But Forms config file has custom definition for my Formsservice (which uses a custom Configuration class.
I would like to know if I can merge services and forms into a single config.yaml and still have the DependencyInjection and Forms get their configuration.
Thanks!
Anything defined in
config.yamlapart fromparameters, needs to be used by anExtension.The
Extensionreceives the config part that belongs to it (defined by thegetAliasmethod).The extension then can call a
Configuratorwhich will process a "well known" configuration, and you can add defaults, etc. This will return a config array.You can then set a parameter in the container, having this configuration array. The container that the Extension receives is an empty one that then gets merged with the real one, receiving the parameters.
Then you can add a
CompilerPassand use these parameters to bind them to your service.