Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitbb371c5

Browse files
committed
[symfony#2397] Adding more empty_data details from previous changes that were removed when merging into 2.1
1 parente6347d5 commitbb371c5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ empty_data
66
This option determines what value the field will return when the ``empty_value``
77
choice is selected.
88

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+
920
For example, if you want the ``gender`` field to be set to ``null`` when no
1021
value is selected, you can do it like this:
1122

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp