Last Updated: May 23, 2016
· pandrieux

Symfony configuration prepend

As described here, symfony provides a way to inject configuration from bundle B to bundle A.

This is amazing but when the bundle B configuration is based on a parameter (like %foo.bar%), the value injected will be the parameter path but not the value.
To transform parameter path into the value, you have to call:
$config = $container->getExtensionConfig($this->getAlias()); $config = $container->getParameterBag()->resolveValue($config); $config = $this->processConfiguration(new Configuration(), $config);
instead of
$config = $container->getExtensionConfig($this->getAlias()); $config = $this->processConfiguration(new Configuration(), $config);

The resolveValue method will fetch the parameters and get each values