Skip to content

Commit a650b93

Browse files
committed
minor symfony#3506 Nykopol overriden options (weaverryan)
This PR was merged into the 2.3 branch. Discussion ---------- Nykopol overriden options See symfony#3417 - this is just a rebase to continue it :) | Q | A | ------------- | --- | Doc fix? | no | New docs? | yes | Applies to | 2.3 | Fixed tickets | symfony#3412 Thanks! Commits ------- e574e97 Removing an extra line thanks to @xabbuh 4f6cb9d Some additional tweaks and probably some merge conflict fixes 362c8b4 document overriden options of choice field 70feefd document overriden options of checkbox c62cd13 correct overriden option of button and add checkbox overriden option ab4aafe correct overriden option of button and add checkbox overriden option
2 parents ab10035 + e574e97 commit a650b93

File tree

5 files changed

+54
-9
lines changed

5 files changed

+54
-9
lines changed

reference/forms/types/button.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ A simple, non-responsive button.
1818
| | - `label_attr`_ |
1919
| | - `translation_domain`_ |
2020
+----------------------+----------------------------------------------------------------------+
21-
| Overridden Options | - `auto_initialize` |
21+
| Overridden options | - `auto_initialize`_ |
2222
+----------------------+----------------------------------------------------------------------+
2323
| Parent type | none |
2424
+----------------------+----------------------------------------------------------------------+

reference/forms/types/checkbox.rst

+11-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ if the box is unchecked, the value will be set to false.
1313
+-------------+------------------------------------------------------------------------+
1414
| Options | - `value`_ |
1515
+-------------+------------------------------------------------------------------------+
16+
| Overridden | - `empty_data`_ |
17+
| options | - `compound`_ |
18+
+-------------+------------------------------------------------------------------------+
1619
| Inherited | - `data`_ |
17-
| options | - `empty_data`_ |
18-
| | - `required`_ |
20+
| options | - `required`_ |
1921
| | - `label`_ |
2022
| | - `label_attr`_ |
2123
| | - `read_only`_ |
@@ -44,6 +46,13 @@ Field Options
4446

4547
.. include:: /reference/forms/types/options/value.rst.inc
4648

49+
Overridden options
50+
------------------
51+
52+
.. include:: /reference/forms/types/options/checkbox_empty_data.rst.inc
53+
54+
.. include:: /reference/forms/types/options/checkbox_compound.rst.inc
55+
4756
Inherited options
4857
-----------------
4958

reference/forms/types/choice.rst

+25-6
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,20 @@ option.
2020
| | - `preferred_choices`_ |
2121
| | - `empty_value`_ |
2222
+-------------+------------------------------------------------------------------------------+
23+
| Overridden | - `empty_data`_ |
24+
| options | - `compound`_ |
25+
| | - `error_bubbling`_ |
26+
+-------------+------------------------------------------------------------------------------+
2327
| Inherited | - `required`_ |
2428
| options | - `label`_ |
2529
| | - `label_attr`_ |
2630
| | - `data`_ |
2731
| | - `read_only`_ |
2832
| | - `disabled`_ |
29-
| | - `error_bubbling`_ |
3033
| | - `error_mapping`_ |
3134
| | - `mapped`_ |
3235
| | - `inherit_data`_ |
3336
| | - `by_reference`_ |
34-
| | - `empty_data`_ |
3537
+-------------+------------------------------------------------------------------------------+
3638
| Parent type | :doc:`form </reference/forms/types/form>` |
3739
+-------------+------------------------------------------------------------------------------+
@@ -109,6 +111,27 @@ can be created to supply the choices.
109111

110112
.. include:: /reference/forms/types/options/empty_value.rst.inc
111113

114+
Overridden options
115+
------------------
116+
117+
.. include:: /reference/forms/types/options/empty_data.rst.inc
118+
119+
compound
120+
~~~~~~~~
121+
122+
**type**: ``boolean`` **default**: same value as ``expanded`` option
123+
124+
This option specifies if a form is compound. The value is by default
125+
overriden by the value of the ``expanded`` option.
126+
127+
error_bubbling
128+
~~~~~~~~~~~~~~
129+
130+
**type**: ``boolean`` **default**: ``false``
131+
132+
Set that error on this field must be attached to the field instead of
133+
the parent field (the form in most cases).
134+
112135
Inherited options
113136
-----------------
114137

@@ -126,14 +149,10 @@ These options inherit from the :doc:`form </reference/forms/types/form>` type:
126149

127150
.. include:: /reference/forms/types/options/disabled.rst.inc
128151

129-
.. include:: /reference/forms/types/options/error_bubbling.rst.inc
130-
131152
.. include:: /reference/forms/types/options/error_mapping.rst.inc
132153

133154
.. include:: /reference/forms/types/options/mapped.rst.inc
134155

135156
.. include:: /reference/forms/types/options/inherit_data.rst.inc
136157

137158
.. include:: /reference/forms/types/options/by_reference.rst.inc
138-
139-
.. include:: /reference/forms/types/options/empty_data.rst.inc
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
compound
2+
~~~~~~~~
3+
4+
**type**: ``boolean`` **default**: ``false``
5+
6+
This option specifies if a form is compound. As it's not the
7+
case for checkbox, by fefault the value is overriden with
8+
``false`` value.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
empty_data
2+
~~~~~~~~~~
3+
4+
**type**: ``string`` **default**: ``mixed``
5+
6+
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.rst`).

0 commit comments

Comments
 (0)