Skip to content

Commit e26f1a1

Browse files
committed
minor #15048 [Bundles] Add part about resolving parameter values to prepend extension (alexander-schranz)
This PR was merged into the 4.4 branch. Discussion ---------- [Bundles] Add part about resolving parameter values to prepend extension I did run into the following issue: symfony/symfony#40198 As when the `$configs` arrray did contain something like `%kernel.debug%` it did error with: > Expected "bool", but got "string". I did debug how symfony is handling this and it seems they are resolving the parameter before here: https://github.com/symfony/symfony/blob/252f85c2c249da7d8f2a490b57cc71199d51fcc9/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php#L54-L62 So I think this should also be part of the Prepend Extension Documentation. Commits ------- 52ce42f Add part about resolving parameter values to prepend extension
2 parents 62afd7c + 52ce42f commit e26f1a1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

bundles/prepend_extension.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ in case a specific other bundle is not registered::
8282

8383
// process the configuration of AcmeHelloExtension
8484
$configs = $container->getExtensionConfig($this->getAlias());
85+
// resolve config parameters e.g. %kernel.debug% to boolean value
86+
$resolvingBag = $container->getParameterBag();
87+
$configs = $resolvingBag->resolveValue($configs);
8588
// use the Configuration class to generate a config array with
8689
// the settings "acme_hello"
8790
$config = $this->processConfiguration(new Configuration(), $configs);

0 commit comments

Comments
 (0)