diff --git a/components/config/definition.rst b/components/config/definition.rst index 0014e8a3f02..03c13d8b33d 100644 --- a/components/config/definition.rst +++ b/components/config/definition.rst @@ -179,10 +179,12 @@ Array node options Before defining the children of an array node, you can provide options like: ``useAttributeAsKey()`` - Provide the name of a child node, whose value should be used as the key in the resulting array + Provide the name of a child node, whose value should be used as the key in the resulting array. ``requiresAtLeastOneElement()`` There should be at least one element in the array (works only when ``isRequired()`` is also called). +``addDefaultsIfNotSet()`` + If any child nodes have default values, use them if explicit values haven't been provided. An example of this:: @@ -198,6 +200,16 @@ An example of this:: ->end() ->end() ->end() + ->arrayNode('settings') + ->useDefaultsIfNotSet() + ->children() + ->scalarNode('name') + ->isRequired() + ->cannotBeEmpty() + ->defaultValue('value') + ->end() + ->end() + ->end() ->end() ;