File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
reference/forms/types/options Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,17 @@ empty_data
6
6
This option determines what value the field will return when the ``empty_value``
7
7
choice is selected.
8
8
9
+ The true default value of this option depends on the field options:
10
+
11
+ * If ``compound`` is ``true`` and ``data_class`` is set, then ``new $data_class()``;
12
+ * If ``compound`` is ``true`` and no ``data_class`` is set, then ``array()``;
13
+ * If ``compound`` is ``false``, then ``null``.
14
+
15
+ .. tip::
16
+
17
+ The ``compound`` option is set to ``true`` when the field actually represents
18
+ a collection of fields (e.g. a form of fields).
19
+
9
20
For example, if you want the ``gender`` field to be set to ``null`` when no
10
21
value is selected, you can do it like this:
11
22
You can’t perform that action at this time.
0 commit comments