Symfony 2 YAML passing arrays Symfony 2 YAML passing arrays symfony symfony

Symfony 2 YAML passing arrays


What you are searching for is not really about Yaml itself, but about the Yaml loader of the Dependency Injection container.

If you search docs about it, here are the ones for the old component (v1): http://components.symfony-project.org/dependency-injection/trunk/book/05-Service-Description

Symfony2 comes with a new component (based on the same principles). You can find the official docs here: http://symfony.com/doc/current/book/service_container.html#service-parameters

Concerning your problem, you cannot access to keys of DI parameters, you have to flatten then manually.

You could use a DI extension to fit your need, take example on some bundles like: https://github.com/symfony/AsseticBundle/blob/master/DependencyInjection/AsseticExtension.php#L54 (maybe not the best example).