Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6b61260

Browse filesBrowse files
committed
field dependent empty_data option description
1 parent 1b695b5 commit 6b61260
Copy full SHA for 6b61260
Expand file treeCollapse file tree

23 files changed

+166
-17
lines changed

‎reference/forms/types/choice.rst

Copy file name to clipboardExpand all lines: reference/forms/types/choice.rst
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,16 @@ Overridden Options
115115
------------------
116116

117117
.. include:: /reference/forms/types/options/empty_data.rst.inc
118+
:end-before: DEFAULT_PLACEHOLDER
119+
120+
The actual default value of this option depends on other field options:
121+
122+
* If ``multiple`` is ``false`` and ``expanded`` is ``false``, then ``''``
123+
(empty string);
124+
* Otherwise ``array()`` (empty array).
125+
126+
.. include:: /reference/forms/types/options/empty_data.rst.inc
127+
:start-after: DEFAULT_PLACEHOLDER
118128

119129
compound
120130
~~~~~~~~

‎reference/forms/types/collection.rst

Copy file name to clipboardExpand all lines: reference/forms/types/collection.rst
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,12 @@ error_bubbling
360360
.. include:: /reference/forms/types/options/by_reference.rst.inc
361361

362362
.. include:: /reference/forms/types/options/empty_data.rst.inc
363+
:end-before: DEFAULT_PLACEHOLDER
364+
365+
The default value is ``array()`` (empty array).
366+
367+
.. include:: /reference/forms/types/options/empty_data.rst.inc
368+
:start-after: DEFAULT_PLACEHOLDER
363369

364370
.. include:: /reference/forms/types/options/required.rst.inc
365371

‎reference/forms/types/country.rst

Copy file name to clipboardExpand all lines: reference/forms/types/country.rst
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,16 @@ These options inherit from the :doc:`choice </reference/forms/types/choice>` typ
7676
These options inherit from the :doc:`form </reference/forms/types/form>` type:
7777

7878
.. include:: /reference/forms/types/options/empty_data.rst.inc
79+
:end-before: DEFAULT_PLACEHOLDER
80+
81+
The actual default value of this option depends on other field options:
82+
83+
* If ``multiple`` is ``false`` and ``expanded`` is ``false``, then ``''``
84+
(empty string);
85+
* Otherwise ``array()`` (empty array).
86+
87+
.. include:: /reference/forms/types/options/empty_data.rst.inc
88+
:start-after: DEFAULT_PLACEHOLDER
7989

8090
.. include:: /reference/forms/types/options/required.rst.inc
8191

‎reference/forms/types/currency.rst

Copy file name to clipboardExpand all lines: reference/forms/types/currency.rst
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,16 @@ These options inherit from the :doc:`choice</reference/forms/types/choice>` type
6666
These options inherit from the :doc:`form</reference/forms/types/form>` type:
6767

6868
.. include:: /reference/forms/types/options/empty_data.rst.inc
69+
:end-before: DEFAULT_PLACEHOLDER
70+
71+
The actual default value of this option depends on other field options:
72+
73+
* If ``multiple`` is ``false`` and ``expanded`` is ``false``, then ``''``
74+
(empty string);
75+
* Otherwise ``array()`` (empty array).
76+
77+
.. include:: /reference/forms/types/options/empty_data.rst.inc
78+
:start-after: DEFAULT_PLACEHOLDER
6979

7080
.. include:: /reference/forms/types/options/required.rst.inc
7181

‎reference/forms/types/email.rst

Copy file name to clipboardExpand all lines: reference/forms/types/email.rst
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ These options inherit from the :doc:`form </reference/forms/types/form>` type:
3636
.. include:: /reference/forms/types/options/max_length.rst.inc
3737

3838
.. include:: /reference/forms/types/options/empty_data.rst.inc
39+
:end-before: DEFAULT_PLACEHOLDER
40+
41+
The default value is ``''`` (the empty string).
42+
43+
.. include:: /reference/forms/types/options/empty_data.rst.inc
44+
:start-after: DEFAULT_PLACEHOLDER
3945

4046
.. include:: /reference/forms/types/options/required.rst.inc
4147

‎reference/forms/types/entity.rst

Copy file name to clipboardExpand all lines: reference/forms/types/entity.rst
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,16 @@ These options inherit from the :doc:`choice </reference/forms/types/choice>` typ
212212
These options inherit from the :doc:`form </reference/forms/types/form>` type:
213213

214214
.. include:: /reference/forms/types/options/empty_data.rst.inc
215+
:end-before: DEFAULT_PLACEHOLDER
216+
217+
The actual default value of this option depends on other field options:
218+
219+
* If ``multiple`` is ``false`` and ``expanded`` is ``false``, then ``''``
220+
(empty string);
221+
* Otherwise ``array()`` (empty array).
222+
223+
.. include:: /reference/forms/types/options/empty_data.rst.inc
224+
:start-after: DEFAULT_PLACEHOLDER
215225

216226
.. include:: /reference/forms/types/options/required.rst.inc
217227

‎reference/forms/types/file.rst

Copy file name to clipboardExpand all lines: reference/forms/types/file.rst
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ Inherited Options
8484
These options inherit from the :doc:`form </reference/forms/types/form>` type:
8585

8686
.. include:: /reference/forms/types/options/empty_data.rst.inc
87+
:end-before: DEFAULT_PLACEHOLDER
88+
89+
The default value is ``null``.
90+
91+
.. include:: /reference/forms/types/options/empty_data.rst.inc
92+
:start-after: DEFAULT_PLACEHOLDER
8793

8894
.. include:: /reference/forms/types/options/required.rst.inc
8995

‎reference/forms/types/form.rst

Copy file name to clipboardExpand all lines: reference/forms/types/form.rst
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,18 @@ Field Options
5353
.. include:: /reference/forms/types/options/data_class.rst.inc
5454

5555
.. include:: /reference/forms/types/options/empty_data.rst.inc
56+
:end-before: DEFAULT_PLACEHOLDER
57+
58+
The actual default value of this option depends on other field options:
59+
60+
* If ``data_class`` is set and ``required`` is ``true``, then ``new $data_class()``;
61+
* If ``data_class`` is set and ``required`` is ``false``, then ``null``;
62+
* If ``data_class`` is not set and ``compound`` is ``true``, then ``array()``
63+
(empty array);
64+
* If ``data_class`` is not set and ``compound`` is ``false``, then ``''`` (empty string).
65+
66+
.. include:: /reference/forms/types/options/empty_data.rst.inc
67+
:start-after: DEFAULT_PLACEHOLDER
5668

5769
.. include:: /reference/forms/types/options/compound.rst.inc
5870

‎reference/forms/types/integer.rst

Copy file name to clipboardExpand all lines: reference/forms/types/integer.rst
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ Inherited Options
7171
These options inherit from the :doc:`form </reference/forms/types/form>` type:
7272

7373
.. include:: /reference/forms/types/options/empty_data.rst.inc
74+
:end-before: DEFAULT_PLACEHOLDER
75+
76+
The default value is ``''`` (the empty string).
77+
78+
.. include:: /reference/forms/types/options/empty_data.rst.inc
79+
:start-after: DEFAULT_PLACEHOLDER
7480

7581
.. include:: /reference/forms/types/options/required.rst.inc
7682

‎reference/forms/types/language.rst

Copy file name to clipboardExpand all lines: reference/forms/types/language.rst
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,16 @@ These options inherit from the :doc:`choice </reference/forms/types/choice>` typ
7777
These options inherit from the :doc:`form </reference/forms/types/form>` type:
7878

7979
.. include:: /reference/forms/types/options/empty_data.rst.inc
80+
:end-before: DEFAULT_PLACEHOLDER
81+
82+
The actual default value of this option depends on other field options:
83+
84+
* If ``multiple`` is ``false`` and ``expanded`` is ``false``, then ``''``
85+
(empty string);
86+
* Otherwise ``array()`` (empty array).
87+
88+
.. include:: /reference/forms/types/options/empty_data.rst.inc
89+
:start-after: DEFAULT_PLACEHOLDER
8090

8191
.. include:: /reference/forms/types/options/required.rst.inc
8292

‎reference/forms/types/locale.rst

Copy file name to clipboardExpand all lines: reference/forms/types/locale.rst
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,16 @@ These options inherit from the :doc:`choice </reference/forms/types/choice>` typ
7979
These options inherit from the :doc:`form </reference/forms/types/form>` type:
8080

8181
.. include:: /reference/forms/types/options/empty_data.rst.inc
82+
:end-before: DEFAULT_PLACEHOLDER
83+
84+
The actual default value of this option depends on other field options:
85+
86+
* If ``multiple`` is ``false`` and ``expanded`` is ``false``, then ``''``
87+
(empty string);
88+
* Otherwise ``array()`` (empty array).
89+
90+
.. include:: /reference/forms/types/options/empty_data.rst.inc
91+
:start-after: DEFAULT_PLACEHOLDER
8292

8393
.. include:: /reference/forms/types/options/required.rst.inc
8494

‎reference/forms/types/money.rst

Copy file name to clipboardExpand all lines: reference/forms/types/money.rst
+8-2Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Specifies the currency that the money is being specified in. This determines
4949
the currency symbol that should be shown by the text box. Depending on
5050
the currency - the currency symbol may be shown before or after the input
5151
text field.
52-
52+
5353
This can be any `3 letter ISO 4217 code`_. You can also set this to false to
5454
hide the currency symbol.
5555

@@ -89,6 +89,12 @@ Inherited Options
8989
These options inherit from the :doc:`form </reference/forms/types/form>` type:
9090

9191
.. include:: /reference/forms/types/options/empty_data.rst.inc
92+
:end-before: DEFAULT_PLACEHOLDER
93+
94+
The default value is ``''`` (the empty string).
95+
96+
.. include:: /reference/forms/types/options/empty_data.rst.inc
97+
:start-after: DEFAULT_PLACEHOLDER
9298

9399
.. include:: /reference/forms/types/options/required.rst.inc
94100

@@ -116,7 +122,7 @@ Form Variables
116122
--------------
117123

118124
============= ========== ===============================================================
119-
Variable Type Usage
125+
Variable Type Usage
120126
============= ========== ===============================================================
121127
money_pattern ``string`` The format to use to display the money, including the currency.
122128
============= ========== ===============================================================

‎reference/forms/types/number.rst

Copy file name to clipboardExpand all lines: reference/forms/types/number.rst
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ rounding_mode
4646
If a submitted number needs to be rounded (based on the ``precision``
4747
option), you have several configurable options for that rounding. Each
4848
option is a constant on the :class:`Symfony\\Component\\Form\\Extension\\Core\\DataTransformer\\IntegerToLocalizedStringTransformer`:
49-
49+
5050
* ``IntegerToLocalizedStringTransformer::ROUND_DOWN`` Rounding mode to
5151
round towards zero.
5252

@@ -79,6 +79,12 @@ Inherited Options
7979
These options inherit from the :doc:`form </reference/forms/types/form>` type:
8080

8181
.. include:: /reference/forms/types/options/empty_data.rst.inc
82+
:end-before: DEFAULT_PLACEHOLDER
83+
84+
The default value is ``''`` (the empty string).
85+
86+
.. include:: /reference/forms/types/options/empty_data.rst.inc
87+
:start-after: DEFAULT_PLACEHOLDER
8288

8389
.. include:: /reference/forms/types/options/required.rst.inc
8490

‎reference/forms/types/options/checkbox_empty_data.rst.inc

Copy file name to clipboardExpand all lines: reference/forms/types/options/checkbox_empty_data.rst.inc
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@ empty_data
44
**type**: ``string`` **default**: ``mixed``
55

66
This option determines what value the field will return when the ``empty_value``
7-
choice is selected.
8-
In checkbox, the value of ``empty_data`` is overriden by the value returned by
9-
the data transformer (see :doc:`/cookbook/form/data_transformers`).
7+
choice is selected. In the checkbox and the radio type, the value of ``empty_data``
8+
is overriden by the value returned by the data transformer (see :doc:`/cookbook/form/data_transformers`).

‎reference/forms/types/options/empty_data.rst.inc

Copy file name to clipboardExpand all lines: reference/forms/types/options/empty_data.rst.inc
+6-10Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
empty_data
22
~~~~~~~~~~
33

4-
**type**: ``mixed`` **default**: depends on other field options, see below
4+
**type**: ``mixed``
55

6-
This option determines what value the field will return when the submitted
7-
value is empty. This may happen when the ``empty_value`` choice in a
8-
``choice`` field is selected or when an ``input`` field of some type is not
9-
required and left empty by the user.
6+
.. This file should only be included with start-after or end-before that's set to
7+
this placeholder value. Its purpose is to let us include only part of this file.
108

11-
The true default value of this option depends on other field options:
9+
DEFAULT_PLACEHOLDER
1210

13-
* If ``data_class`` is set and ``required`` is ``true``, then ``new $data_class()``;
14-
* If ``data_class`` is set and ``required`` is ``false``, then ``null``;
15-
* If ``data_class`` is not set and ``compound`` is ``true``, then ``array()``;
16-
* If ``data_class`` is not set and ``compound`` is ``false``, then ``''`` (empty string).
11+
This option determines what value the field will return when the submitted
12+
value is empty.
1713

1814
But you can customize this to your needs. For example, if you want the
1915
``gender`` choice field to be explicitly set to ``null`` when no value is

‎reference/forms/types/password.rst

Copy file name to clipboardExpand all lines: reference/forms/types/password.rst
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ These options inherit from the :doc:`form </reference/forms/types/form>` type:
5353
.. include:: /reference/forms/types/options/max_length.rst.inc
5454

5555
.. include:: /reference/forms/types/options/empty_data.rst.inc
56+
:end-before: DEFAULT_PLACEHOLDER
57+
58+
The default value is ``''`` (the empty string).
59+
60+
.. include:: /reference/forms/types/options/empty_data.rst.inc
61+
:start-after: DEFAULT_PLACEHOLDER
5662

5763
.. include:: /reference/forms/types/options/required.rst.inc
5864

‎reference/forms/types/percent.rst

Copy file name to clipboardExpand all lines: reference/forms/types/percent.rst
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ Inherited Options
7373
These options inherit from the :doc:`form </reference/forms/types/form>` type:
7474

7575
.. include:: /reference/forms/types/options/empty_data.rst.inc
76+
:end-before: DEFAULT_PLACEHOLDER
77+
78+
The default value is ``''`` (the empty string).
79+
80+
.. include:: /reference/forms/types/options/empty_data.rst.inc
81+
:start-after: DEFAULT_PLACEHOLDER
7682

7783
.. include:: /reference/forms/types/options/required.rst.inc
7884

‎reference/forms/types/radio.rst

Copy file name to clipboardExpand all lines: reference/forms/types/radio.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ These options inherit from the :doc:`form </reference/forms/types/form>` type:
4444

4545
.. include:: /reference/forms/types/options/data.rst.inc
4646

47-
.. include:: /reference/forms/types/options/empty_data.rst.inc
47+
.. include:: /reference/forms/types/options/checkbox_empty_data.rst.inc
4848

4949
.. include:: /reference/forms/types/options/required.rst.inc
5050

‎reference/forms/types/search.rst

Copy file name to clipboardExpand all lines: reference/forms/types/search.rst
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ These options inherit from the :doc:`form </reference/forms/types/form>` type:
3737
.. include:: /reference/forms/types/options/max_length.rst.inc
3838

3939
.. include:: /reference/forms/types/options/empty_data.rst.inc
40+
:end-before: DEFAULT_PLACEHOLDER
41+
42+
The default value is ``''`` (the empty string).
43+
44+
.. include:: /reference/forms/types/options/empty_data.rst.inc
45+
:start-after: DEFAULT_PLACEHOLDER
4046

4147
.. include:: /reference/forms/types/options/required.rst.inc
4248

‎reference/forms/types/text.rst

Copy file name to clipboardExpand all lines: reference/forms/types/text.rst
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ These options inherit from the :doc:`form </reference/forms/types/form>` type:
3636
.. include:: /reference/forms/types/options/max_length.rst.inc
3737

3838
.. include:: /reference/forms/types/options/empty_data.rst.inc
39+
:end-before: DEFAULT_PLACEHOLDER
40+
41+
The default value is ``''`` (the empty string).
42+
43+
.. include:: /reference/forms/types/options/empty_data.rst.inc
44+
:start-after: DEFAULT_PLACEHOLDER
3945

4046
.. include:: /reference/forms/types/options/required.rst.inc
4147

‎reference/forms/types/textarea.rst

Copy file name to clipboardExpand all lines: reference/forms/types/textarea.rst
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ These options inherit from the :doc:`form </reference/forms/types/form>` type:
3535
.. include:: /reference/forms/types/options/max_length.rst.inc
3636

3737
.. include:: /reference/forms/types/options/empty_data.rst.inc
38+
:end-before: DEFAULT_PLACEHOLDER
39+
40+
The default value is ``''`` (the empty string).
41+
42+
.. include:: /reference/forms/types/options/empty_data.rst.inc
43+
:start-after: DEFAULT_PLACEHOLDER
3844

3945
.. include:: /reference/forms/types/options/required.rst.inc
4046

‎reference/forms/types/timezone.rst

Copy file name to clipboardExpand all lines: reference/forms/types/timezone.rst
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,16 @@ These options inherit from the :doc:`choice </reference/forms/types/choice>` typ
6868
These options inherit from the :doc:`form </reference/forms/types/form>` type:
6969

7070
.. include:: /reference/forms/types/options/empty_data.rst.inc
71+
:end-before: DEFAULT_PLACEHOLDER
72+
73+
The actual default value of this option depends on other field options:
74+
75+
* If ``multiple`` is ``false`` and ``expanded`` is ``false``, then ``''``
76+
(empty string);
77+
* Otherwise ``array()`` (empty array).
78+
79+
.. include:: /reference/forms/types/options/empty_data.rst.inc
80+
:start-after: DEFAULT_PLACEHOLDER
7181

7282
.. include:: /reference/forms/types/options/required.rst.inc
7383

‎reference/forms/types/url.rst

Copy file name to clipboardExpand all lines: reference/forms/types/url.rst
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ These options inherit from the :doc:`form </reference/forms/types/form>` type:
5151
.. include:: /reference/forms/types/options/max_length.rst.inc
5252

5353
.. include:: /reference/forms/types/options/empty_data.rst.inc
54+
:end-before: DEFAULT_PLACEHOLDER
55+
56+
The default value is ``''`` (the empty string).
57+
58+
.. include:: /reference/forms/types/options/empty_data.rst.inc
59+
:start-after: DEFAULT_PLACEHOLDER
5460

5561
.. include:: /reference/forms/types/options/required.rst.inc
5662

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.