Skip to content

Commit cd8f49b

Browse files
committed
feature #5313 Documented the overridden form options (javiereguiluz)
This PR was merged into the 2.3 branch. Discussion ---------- Documented the overridden form options | Q | A | ------------- | --- | Doc fix? | no | New docs? | yes | Applies to | all | Fixed tickets | #3412 Commits ------- 84633db Fixed a typo 596a0bc Reordered two overridden options 62a11d5 Added missing types in overridden options 2b63f24 Fixed the order of the different options e14b650 Fixed the order of the different options 0a5781b Improved the explanation about the "compoun" option eb20dc8 Fixer minor issues 974dfef Fixed errors noticed by Wouter 32c0af1 Removed a duplicated "trim" option in the "password" type 1dc53fa Removed again a duplicated option explanation 7f8e09a Removed a duplicated option explanation in "file" type 48b402b Extracted the common "data_class" option explanation for data-related types f44e971 Documented the overridden options of "date" type e41b3cc Documented overridden options for "file" type 8e825d9 Documented the overridden options of the "password" type 618e11d Documented the overridden options for "time" type 7ce8191 Documented overridden options for hidden field a8ad338 Documented overriden options for numeric types e66ec5c Created a compound_type file because this option is shared with lots of types 8d360d9 Documented the Overridden Options of the Text type
2 parents 314da54 + 84633db commit cd8f49b

20 files changed

+145
-32
lines changed

reference/forms/types/country.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ you should just use the ``choice`` type directly.
2323
| Rendered as | can be various tags (see :ref:`forms-reference-choice-tags`) |
2424
+-------------+-----------------------------------------------------------------------+
2525
| Overridden | - `choices`_ |
26-
| Options | |
26+
| options | |
2727
+-------------+-----------------------------------------------------------------------+
2828
| Inherited | from the :doc:`choice </reference/forms/types/choice>` type |
2929
| options | |

reference/forms/types/currency.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ you should just use the ``choice`` type directly.
1717
| Rendered as | can be various tags (see :ref:`forms-reference-choice-tags`) |
1818
+-------------+------------------------------------------------------------------------+
1919
| Overridden | - `choices`_ |
20-
| Options | |
20+
| options | |
2121
+-------------+------------------------------------------------------------------------+
2222
| Inherited | from the :doc:`choice </reference/forms/types/choice>` type |
2323
| options | |

reference/forms/types/date.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ day and year) or three select boxes (see the `widget`_ option).
2929
| | - `widget`_ |
3030
| | - `years`_ |
3131
+----------------------+-----------------------------------------------------------------------------+
32-
| Overridden Options | - `by_reference`_ |
32+
| Overridden options | - `by_reference`_ |
33+
| | - `compound`_ |
34+
| | - `data_class`_ |
3335
| | - `error_bubbling`_ |
3436
+----------------------+-----------------------------------------------------------------------------+
3537
| Inherited | - `data`_ |
@@ -125,6 +127,10 @@ by_reference
125127

126128
The ``DateTime`` classes are treated as immutable objects.
127129

130+
.. include:: /reference/forms/types/options/compound_type.rst.inc
131+
132+
.. include:: /reference/forms/types/options/data_class_date.rst.inc
133+
128134
error_bubbling
129135
~~~~~~~~~~~~~~
130136

reference/forms/types/datetime.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ the data can be a ``DateTime`` object, a string, a timestamp or an array.
3333
| | - `with_seconds`_ |
3434
| | - `years`_ |
3535
+----------------------+-----------------------------------------------------------------------------+
36+
| Overridden options | - `by_reference`_ |
37+
| | - `compound`_ |
38+
| | - `data_class`_ |
39+
| | - `error_bubbling`_ |
40+
+----------------------+-----------------------------------------------------------------------------+
3641
| Inherited | - `data`_ |
3742
| options | - `disabled`_ |
3843
| | - `inherit_data`_ |
@@ -131,6 +136,25 @@ with the `date_widget`_ and `time_widget`_ options.
131136

132137
.. include:: /reference/forms/types/options/years.rst.inc
133138

139+
Overridden Options
140+
------------------
141+
142+
by_reference
143+
~~~~~~~~~~~~
144+
145+
**default**: ``false``
146+
147+
The ``DateTime`` classes are treated as immutable objects.
148+
149+
.. include:: /reference/forms/types/options/compound_type.rst.inc
150+
151+
.. include:: /reference/forms/types/options/data_class_date.rst.inc
152+
153+
error_bubbling
154+
~~~~~~~~~~~~~~
155+
156+
**default**: ``false``
157+
134158
Inherited Options
135159
-----------------
136160

reference/forms/types/entity.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ objects from the database.
1919
| | - `property`_ |
2020
| | - `query_builder`_ |
2121
+-------------+------------------------------------------------------------------+
22-
| Overriden | - `choice_list`_ |
22+
| Overridden | - `choice_list`_ |
2323
| options | - `choices`_ |
2424
+-------------+------------------------------------------------------------------+
2525
| Inherited | from the :doc:`choice </reference/forms/types/choice>` type: |

reference/forms/types/file.rst

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ The ``file`` type represents a file input in your form.
99
+-------------+---------------------------------------------------------------------+
1010
| Rendered as | ``input`` ``file`` field |
1111
+-------------+---------------------------------------------------------------------+
12+
| Overridden | - `compound`_ |
13+
| options | - `data_class`_ |
14+
| | - `empty_data`_ |
15+
+-------------+---------------------------------------------------------------------+
1216
| Inherited | - `disabled`_ |
13-
| options | - `empty_data`_ |
14-
| | - `error_bubbling`_ |
17+
| options | - `error_bubbling`_ |
1518
| | - `error_mapping`_ |
1619
| | - `label`_ |
1720
| | - `label_attr`_ |
@@ -24,6 +27,26 @@ The ``file`` type represents a file input in your form.
2427
| Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\FileType` |
2528
+-------------+---------------------------------------------------------------------+
2629

30+
Overridden Options
31+
------------------
32+
33+
.. include:: /reference/forms/types/options/compound_type.rst.inc
34+
35+
data_class
36+
~~~~~~~~~~
37+
38+
**type**: ``string`` **default**: :class:`Symfony\\Component\\HttpFoundation\\File\\File`
39+
40+
This option sets the appropriate file-related data mapper to be used by the type.
41+
42+
empty_data
43+
~~~~~~~~~~
44+
45+
**type**: ``mixed`` **default**: ``null``
46+
47+
This option determines what value the field will return when the submitted
48+
value is empty.
49+
2750
Basic Usage
2851
-----------
2952

@@ -82,14 +105,6 @@ type:
82105

83106
.. include:: /reference/forms/types/options/disabled.rst.inc
84107

85-
.. include:: /reference/forms/types/options/empty_data.rst.inc
86-
:end-before: DEFAULT_PLACEHOLDER
87-
88-
The default value is ``null``.
89-
90-
.. include:: /reference/forms/types/options/empty_data.rst.inc
91-
:start-after: DEFAULT_PLACEHOLDER
92-
93108
.. include:: /reference/forms/types/options/error_bubbling.rst.inc
94109

95110
.. include:: /reference/forms/types/options/error_mapping.rst.inc

reference/forms/types/hidden.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ The hidden type represents a hidden input field.
99
+-------------+----------------------------------------------------------------------+
1010
| Rendered as | ``input`` ``hidden`` field |
1111
+-------------+----------------------------------------------------------------------+
12-
| Overriden | - `error_bubbling`_ |
13-
| options | - `required`_ |
12+
| Overriden | - `compound`_ |
13+
| options | - `error_bubbling`_ |
14+
| | - `required`_ |
1415
+-------------+----------------------------------------------------------------------+
1516
| Inherited | - `data`_ |
1617
| options | - `error_mapping`_ |
@@ -25,6 +26,8 @@ The hidden type represents a hidden input field.
2526
Overridden Options
2627
------------------
2728

29+
.. include:: /reference/forms/types/options/compound_type.rst.inc
30+
2831
error_bubbling
2932
~~~~~~~~~~~~~~
3033

reference/forms/types/integer.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ integers. By default, all non-integer values (e.g. 6.78) will round down
1616
+-------------+-----------------------------------------------------------------------+
1717
| Rendered as | ``input`` ``number`` field |
1818
+-------------+-----------------------------------------------------------------------+
19+
| Overridden | - `compound`_ |
20+
| options | |
21+
+-------------+-----------------------------------------------------------------------+
1922
| Options | - `grouping`_ |
2023
| | - `precision`_ |
2124
| | - `rounding_mode`_ |
@@ -38,6 +41,11 @@ integers. By default, all non-integer values (e.g. 6.78) will round down
3841
| Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\IntegerType` |
3942
+-------------+-----------------------------------------------------------------------+
4043

44+
Overridden Options
45+
------------------
46+
47+
.. include:: /reference/forms/types/options/compound_type.rst.inc
48+
4149
Field Options
4250
-------------
4351

reference/forms/types/language.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ you should just use the ``choice`` type directly.
2424
| Rendered as | can be various tags (see :ref:`forms-reference-choice-tags`) |
2525
+-------------+------------------------------------------------------------------------+
2626
| Overridden | - `choices`_ |
27-
| Options | |
27+
| options | |
2828
+-------------+------------------------------------------------------------------------+
2929
| Inherited | from the :doc:`choice </reference/forms/types/choice>` type |
3030
| options | |

reference/forms/types/locale.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ you should just use the ``choice`` type directly.
2626
| Rendered as | can be various tags (see :ref:`forms-reference-choice-tags`) |
2727
+-------------+------------------------------------------------------------------------+
2828
| Overridden | - `choices`_ |
29-
| Options | |
29+
| options | |
3030
+-------------+------------------------------------------------------------------------+
3131
| Inherited | from the :doc:`choice </reference/forms/types/choice>` type |
3232
| options | |

0 commit comments

Comments
 (0)