File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed
reference/forms/types/options Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,22 @@ compound
33
44**type**: ``boolean`` **default**: ``true``
55
6- This option specifies if a form is compound. This is independent of whether
7- the form actually has children. A form can be compound but not have any
8- children at all (e.g. an empty collection form).
6+ If ``true`` this option creates the form as "compound", meaning that it
7+ can contain children and be a parent of other forms.
8+
9+ Most of the time you won't need to override this option.
10+ You might want to control for it when creating a custom form type
11+ with advanced rendering logic.
12+
13+ In a view a compound form is rendered as a ``< div > `` container or
14+ a ``< form > `` element (the whole form is obviously a compound form).
15+
16+ Non-compound forms are always leaves in a form tree, they cannot have children.
17+
18+ A non-compound form is rendered as one of the html form elements: ``< input > ``
19+ (``TextType``, ``FileType``, ``HiddenType``), ``< textarea > `` (``TextareaType``)
20+ or ``< select > `` (``ChoiceType``).
21+
22+ An interesting case is the ``ChoiceType``. With ``expanded=false`` it is a non-compound form
23+ and is rendered as a ``< select > `` tag. With ``expanded=true`` the ``ChoiceType`` becomes a
24+ compound form and is rendered as a set of radios or checkboxes.
You can’t perform that action at this time.
0 commit comments