8000 minor #5787 Definition Tweaks - see #5314 (weaverryan) · symfony/symfony-docs@b2a9a6c · GitHub
[go: up one dir, main page]

Skip to content

Commit b2a9a6c

Browse files
committed
minor #5787 Definition Tweaks - see #5314 (weaverryan)
This PR was merged into the 2.3 branch. Discussion ---------- Definition Tweaks - see #5314 | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | all | Fixed tickets | n/a See #5314 - I am quite a novice with the Configuration component :). Commits ------- 51bc906 Fixes thanks to Stof 4e788e4 fixing build failure 67b8ff2 Tweaks - see #5314
2 parents 4d04ccf + 51bc906 commit b2a9a6c

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

components/config/definition.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,10 @@ 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* normalized to underscores.
217+
It is recommended to use this with prototype nodes where the user will define
218+
a key-value map, to avoid an unnecessary transformation.
215219

216220
A basic prototyped array configuration can be defined as follows::
217221

@@ -310,6 +314,13 @@ The output configuration will be exactly the same as before. In other words, the
310314
``sf_connection`` and ``default`` configuration keys are lost. The reason is that
311315
the Symfony Config component treats arrays as lists by default.
312316

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

315326
$node

cookbook/event_dispatcher/event_listener.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ Request Events, Checking Types
223223
A single page can make several requests (one master request, and then multiple
224224
sub-requests - typically by :ref:`templating-embedding-controller`). For the core
225225
Symfony events, you might need to check to see if the event is for a "master" request
226-
or a "sub request":
226+
or a "sub request"::
227227

228228
// src/AppBundle/EventListener/RequestListener.php
229229
namespace AppBundle\EventListener;

0 commit comments

Comments
 (0)
0