Skip to content

Commit 67b8ff2

Browse files
committed
Tweaks - see #5314
1 parent 4d04ccf commit 67b8ff2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

components/config/definition.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ Before defining the children of an array node, you can provide options like:
212212
``addDefaultsIfNotSet()``
213213
If any child nodes have default values, use them if explicit values
214214
haven't been provided.
215+
``normalizeKeys(false)``
216+
If called (with ``false``), keys with dashes are *not* normaled to underscores.
217+
It is recommended to use this to avoid this unnecessary normalization.
215218

216219
A basic prototyped array configuration can be defined as follows::
217220

@@ -310,6 +313,12 @@ The output configuration will be exactly the same as before. In other words, the
310313
``sf_connection`` and ``default`` configuration keys are lost. The reason is that
311314
the Symfony Config component treats arrays as lists by default.
312315

316+
.. note::
317+
318+
As of writing this, there is an inconsistency: if only one file is processed,
319+
the keys (i.e. ``sf_connection`` and ``default``) are *not* lost. But if more
320+
than one file is processed, the keys are lost as described above.
321+
313322
In order to maintain the array keys use the ``useAttributeAsKey()`` method::
314323

315324
$node

0 commit comments

Comments
 (0)