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
Written by pandrieux
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Symfony
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#