From b8fa38f2614f86606259e03e74df820fd613d753 Mon Sep 17 00:00:00 2001 From: craig Date: Wed, 6 Feb 2013 11:03:52 +0000 Subject: [PATCH] Add documentation for 'useDefaultsIfNotSet()' configuration method --- components/config/definition.rst | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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() ;