Skip to content

Commit d104357

Browse files
Introducing the new param() function as early as possible
1 parent 422bf52 commit d104357

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

configuration.rst

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ reusable configuration value. By convention, parameters are defined under the
298298
299299
Once defined, you can reference this parameter value from any other
300300
configuration file using a special syntax: wrap the parameter name in two ``%``
301-
(e.g. ``%app.admin_email%``):
301+
(e.g. ``%app.admin_email%``). In PHP you can also use the ``param()`` function:
302302

303303
.. configuration-block::
304304

@@ -309,8 +309,6 @@ configuration file using a special syntax: wrap the parameter name in two ``%``
309309
# any string surrounded by two % is replaced by that parameter value
310310
email_address: '%app.admin_email%'
311311
312-
# ...
313-
314312
.. code-block:: xml
315313
316314
<!-- config/packages/some_package.xml -->
@@ -333,13 +331,13 @@ configuration file using a special syntax: wrap the parameter name in two ``%``
333331
334332
// config/packages/some_package.php
335333
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
334+
use function Symfony\Component\DependencyInjection\Loader\Configurator\param;
336335
337336
return static function (ContainerConfigurator $containerConfigurator) {
338337
$containerConfigurator->extension('some_package', [
339-
// any string surrounded by two % is replaced by that parameter value
338+
'email_address' => param('app.admin_email'),
339+
// or:
340340
'email_address' => '%app.admin_email%',
341-
342-
// ...
343341
]);
344342
};
345343

0 commit comments

Comments
 (0)