Skip to content

Commit 48c0c87

Browse files
committed
Added docs for enum nodes
1 parent 3081634 commit 48c0c87

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

components/config/definition.rst

+19
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,25 @@ node definition. Node type are available for:
106106
and are created with ``node($name, $type)`` or their associated shortcut
107107
``xxxxNode($name)`` method.
108108

109+
Enum nodes
110+
~~~~~~~~~~
111+
112+
.. versionadded:: 2.1
113+
The enum node is new in 2.1
114+
115+
Enum nodes provide a constraint to match the given input against a set of
116+
values::
117+
118+
$rootNode
119+
->children()
120+
->enumNode('gender')
121+
->values(array('male', 'female'))
122+
->end()
123+
->end()
124+
;
125+
126+
This will restrict the ``gender`` option to be either ``male`` or ``female``.
127+
109128
Array nodes
110129
~~~~~~~~~~~
111130

0 commit comments

Comments
 (0)