File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -304,8 +304,6 @@ configuration file using a special syntax: wrap the parameter name in two ``%``
304304 # any string surrounded by two % is replaced by that parameter value
305305 email_address : ' %app.admin_email%'
306306
307- # ...
308-
309307 .. code-block :: xml
310308
311309 <!-- config/packages/some_package.xml -->
@@ -328,13 +326,17 @@ configuration file using a special syntax: wrap the parameter name in two ``%``
328326
329327 // config/packages/some_package.php
330328 namespace Symfony\Component\DependencyInjection\Loader\Configurator;
329+ use function Symfony\Component\DependencyInjection\Loader\Configurator\param;
331330
332331 return static function (ContainerConfigurator $container) {
333332 $container->extension('some_package', [
334- // any string surrounded by two % is replaced by that parameter value
335- 'email_address' => '% app.admin_email%' ,
333+ // when using the param() function, you only have to pass the parameter name...
334+ 'email_address' => param(' app.admin_email') ,
336335
337- // ...
336+ // ... but if you prefer it, you can also pass the name as a string
337+ // surrounded by two % (same as in YAML and XML formats) and Symfony will
338+ // replace it by that parameter value
339+ 'email_address' => '%app.admin_email%',
338340 ]);
339341 };
340342
You can’t perform that action at this time.
0 commit comments