Skip to content

Commit 4973c9b

Browse files
committed
minor #13423 Add note about special handling of 'name' argument (melkamar)
This PR was submitted for the 5.0 branch but it was merged into the 3.4 branch instead (closes #13423). Discussion ---------- Add note about special handling of 'name' argument Fixes #13422 <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/roadmap for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> Commits ------- 08ae842 Add note about special handling of 'name' argument
2 parents 3e6ea42 + 08ae842 commit 4973c9b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

components/config/definition.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,10 @@ In order to maintain the array keys use the ``useAttributeAsKey()`` method::
357357
->end()
358358
;
359359

360+
.. note::
361+
362+
If using YAML, then the ``'name'`` argument of ``useAttributeAsKey`` has a special meaning and refers to the key of the map (``sf_connection`` and ``default`` in this example). If a child node was defined for the ``connections`` node with the name ``name``, then the key of the map would be lost.
363+
360364
The argument of this method (``name`` in the example above) defines the name of
361365
the attribute added to each XML node to differentiate them. Now you can use the
362366
same YAML configuration shown before or the following XML configuration:

0 commit comments

Comments
 (0)