File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ day, and year) or three select boxes (see the `widget_` option).
21
21
+----------------------+-----------------------------------------------------------------------------+
22
22
| Options | - `widget `_ |
23
23
| | - `input `_ |
24
+ | | - `empty_value `_ |
24
25
| | - `years `_ |
25
26
| | - `months `_ |
26
27
| | - `days `_ |
@@ -74,6 +75,25 @@ Field Options
74
75
75
76
.. include :: /reference/forms/types/options/date_input.rst.inc
76
77
78
+ empty_value
79
+ ~~~~~~~~~~~
80
+
81
+ **type **: ``string``|``array ``
82
+
83
+ If your widget option is set to ``choice ``, then this field will be represented
84
+ as a series of ``select `` boxes. The ``empty_value `` option can be used to
85
+ add a "blank" entry to the top of each select box::
86
+
87
+ $builder->add('dueDate', 'date', array(
88
+ 'empty_value' => '',
89
+ ));
90
+
91
+ Alternatively, you can specify a string to be displayed for the "blank" value::
92
+
93
+ $builder->add('dueDate', 'date', array(
94
+ 'empty_value' => array('year' => 'Year', 'month' => 'Month', 'day' => 'Day')
95
+ ));
96
+
77
97
.. include :: /reference/forms/types/options/years.rst.inc
78
98
79
99
.. include :: /reference/forms/types/options/months.rst.inc
You can’t perform that action at this time.
0 commit comments