From 48c0c8759653031d5f296f67f93d5dca780a3613 Mon Sep 17 00:00:00 2001 From: WouterJ Date: Thu, 6 Jun 2013 22:03:20 +0200 Subject: [PATCH] Added docs for enum nodes --- components/config/definition.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/components/config/definition.rst b/components/config/definition.rst index e9d6aa6d2d6..657e70f262c 100644 --- a/components/config/definition.rst +++ b/components/config/definition.rst @@ -106,6 +106,25 @@ node definition. Node type are available for: and are created with ``node($name, $type)`` or their associated shortcut ``xxxxNode($name)`` method. +Enum nodes +~~~~~~~~~~ + +.. versionadded:: 2.1 + The enum node is new in 2.1 + +Enum nodes provide a constraint to match the given input against a set of +values:: + + $rootNode + ->children() + ->enumNode('gender') + ->values(array('male', 'female')) + ->end() + ->end() + ; + +This will restrict the ``gender`` option to be either ``male`` or ``female``. + Array nodes ~~~~~~~~~~~