-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Definition Tweaks - see #5314 #5787
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -212,6 +212,9 @@ Before defining the children of an array node, you can provide options like: | |
``addDefaultsIfNotSet()`` | ||
If any child nodes have default values, use them if explicit values | ||
haven't been provided. | ||
``normalizeKeys(false)`` | ||
If called (with ``false``), keys with dashes are *not* normaled to underscores. | ||
It is recommended to use this to avoid this unnecessary normalization. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. only for prototyped nodes (and when it is a map, as it does not make sense for a list where keys are numeric) |
||
|
||
A basic prototyped array configuration can be defined as follows:: | ||
|
||
|
@@ -310,6 +313,12 @@ The output configuration will be exactly the same as before. In other words, the | |
``sf_connection`` and ``default`` configuration keys are lost. The reason is that | ||
the Symfony Config component treats arrays as lists by default. | ||
|
||
.. note:: | ||
|
||
As of writing this, there is an inconsistency: if only one file is processed, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. even when multiple files are processed (which happens in all Symfony projects, as nobody puts the whole configuration if |
||
the keys (i.e. ``sf_connection`` and ``default``) are *not* lost. But if more | ||
than one file is processed, the keys are lost as described above. | ||
|
||
In order to maintain the array keys use the ``useAttributeAsKey()`` method:: | ||
|
||
$node | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo here:
normalized