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 ec8990e

Browse filesBrowse files
committed
minor #9361 Add help option to FormType (mpiot)
This PR was squashed before being merged into the 4.1 branch (closes #9361). Discussion ---------- Add help option to FormType Add documentation about the new feature symfony/symfony#26332 Commits ------- 5bdf708 Add help option to FormType
2 parents 139c3d2 + 5bdf708 commit ec8990e
Copy full SHA for ec8990e

36 files changed

+125
-0
lines changed

‎form/form_customization.rst

Copy file name to clipboardExpand all lines: form/form_customization.rst
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ You can also render each of the three parts of the field individually:
3636
{{ form_label(form.age) }}
3737
{{ form_errors(form.age) }}
3838
{{ form_widget(form.age) }}
39+
{{ form_help(form.age) }}
3940
</div>
4041

4142
.. code-block:: php
@@ -798,6 +799,7 @@ You can also override the markup for an entire field row using the same method:
798799
{{ form_label(form) }}
799800
{{ form_errors(form) }}
800801
{{ form_widget(form) }}
802+
{{ form_help(form) }}
801803
</div>
802804
{% endblock %}
803805

@@ -1026,6 +1028,7 @@ class to the ``div`` element around each row:
10261028
{{ form_label(form) }}
10271029
{{ form_errors(form) }}
10281030
{{ form_widget(form) }}
1031+
{{ form_help(form) }}
10291032
</div>
10301033
{% endblock form_row %}
10311034

‎form/form_themes.rst

Copy file name to clipboardExpand all lines: form/form_themes.rst
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ do this, create a new template file that will store the new markup:
3535
{{ form_label(form) }}
3636
{{ form_errors(form) }}
3737
{{ form_widget(form) }}
38+
{{ form_help(form) }}
3839
</div>
3940
{% endspaceless %}
4041
{% endblock form_row %}
@@ -135,6 +136,8 @@ are 4 possible *parts* of a form that can be rendered:
135136
+-------------+----------------------------+---------------------------------------------------------+
136137
| ``errors`` | (e.g. ``form_errors()``) | renders the field's errors |
137138
+-------------+----------------------------+---------------------------------------------------------+
139+
| ``help`` | (e.g. ``form_help()``) | renders the field's help |
140+
+-------------+----------------------------+---------------------------------------------------------+
138141
| ``row`` | (e.g. ``form_row()``) | renders the field's entire row (label, widget & errors) |
139142
+-------------+----------------------------+---------------------------------------------------------+
140143

‎form/rendering.rst

Copy file name to clipboardExpand all lines: form/rendering.rst
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,14 @@ used the ``form_row()`` helper:
8282
{{ form_label(form.task) }}
8383
{{ form_errors(form.task) }}
8484
{{ form_widget(form.task) }}
85+
{{ form_help(form.task) }}
8586
</div>
8687

8788
<div>
8889
{{ form_label(form.dueDate) }}
8990
{{ form_errors(form.dueDate) }}
9091
{{ form_widget(form.dueDate) }}
92+
{{ form_help(form.dueDate) }}
9193
</div>
9294

9395
<div>

‎reference/forms/types/birthday.rst

Copy file name to clipboardExpand all lines: reference/forms/types/birthday.rst
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ option defaults to 120 years ago to the current year.
3838
| | |
3939
| | - `data`_ |
4040
| | - `disabled`_ |
41+
| | - `help`_ |
4142
| | - `inherit_data`_ |
4243
| | - `invalid_message`_ |
4344
| | - `invalid_message_parameters`_ |
@@ -108,6 +109,8 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:
108109

109110
.. include:: /reference/forms/types/options/disabled.rst.inc
110111

112+
.. include:: /reference/forms/types/options/help.rst.inc
113+
111114
.. include:: /reference/forms/types/options/inherit_data.rst.inc
112115

113116
.. include:: /reference/forms/types/options/invalid_message.rst.inc

‎reference/forms/types/checkbox.rst

Copy file name to clipboardExpand all lines: reference/forms/types/checkbox.rst
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ true, if the box is unchecked, the value will be set to false.
2020
| options | - `disabled`_ |
2121
| | - `error_bubbling`_ |
2222
| | - `error_mapping`_ |
23+
| | - `help`_ |
2324
| | - `label`_ |
2425
| | - `label_attr`_ |
2526
| | - `label_format`_ |
@@ -69,6 +70,8 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:
6970

7071
.. include:: /reference/forms/types/options/error_mapping.rst.inc
7172

73+
.. include:: /reference/forms/types/options/help.rst.inc
74+
7275
.. include:: /reference/forms/types/options/label.rst.inc
7376

7477
.. include:: /reference/forms/types/options/label_attr.rst.inc

‎reference/forms/types/choice.rst

Copy file name to clipboardExpand all lines: reference/forms/types/choice.rst
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ To use this field, you must specify *either* ``choices`` or ``choice_loader`` op
3535
| | - `data`_ |
3636
| | - `disabled`_ |
3737
| | - `error_mapping`_ |
38+
| | - `help`_ |
3839
| | - `inherit_data`_ |
3940
| | - `label`_ |
4041
| | - `label_attr`_ |
@@ -267,6 +268,8 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:
267268

268269
.. include:: /reference/forms/types/options/error_mapping.rst.inc
269270

271+
.. include:: /reference/forms/types/options/help.rst.inc
272+
270273
.. include:: /reference/forms/types/options/inherit_data.rst.inc
271274

272275
.. include:: /reference/forms/types/options/label.rst.inc

‎reference/forms/types/collection.rst

Copy file name to clipboardExpand all lines: reference/forms/types/collection.rst
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ photos).
2727
| options | - `empty_data`_ |
2828
| | - `error_bubbling`_ |
2929
| | - `error_mapping`_ |
30+
| | - `help`_ |
3031
| | - `label`_ |
3132
| | - `label_attr`_ |
3233
| | - `label_format`_ |
@@ -448,6 +449,8 @@ error_bubbling
448449

449450
.. include:: /reference/forms/types/options/error_mapping.rst.inc
450451

452+
.. include:: /reference/forms/types/options/help.rst.inc
453+
451454
.. include:: /reference/forms/types/options/label.rst.inc
452455

453456
.. include:: /reference/forms/types/options/label_attr.rst.inc

‎reference/forms/types/color.rst

Copy file name to clipboardExpand all lines: reference/forms/types/color.rst
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ element.
2222
| | - `empty_data`_ |
2323
| | - `error_bubbling`_ |
2424
| | - `error_mapping`_ |
25+
| | - `help`_ |
2526
| | - `label`_ |
2627
| | - `label_attr`_ |
2728
| | - `label_format`_ |
@@ -55,6 +56,8 @@ The default value is ``''`` (the empty string).
5556

5657
.. include:: /reference/forms/types/options/error_mapping.rst.inc
5758

59+
.. include:: /reference/forms/types/options/help.rst.inc
60+
5861
.. include:: /reference/forms/types/options/label.rst.inc
5962

6063
.. include:: /reference/forms/types/options/label_attr.rst.inc

‎reference/forms/types/country.rst

Copy file name to clipboardExpand all lines: reference/forms/types/country.rst
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ the option manually, but then you should just use the ``ChoiceType`` directly.
3939
| | - `data`_ |
4040
| | - `disabled`_ |
4141
| | - `empty_data`_ |
42+
| | - `help`_ |
4243
| | - `label`_ |
4344
| | - `label_attr`_ |
4445
| | - `label_format`_ |
@@ -103,6 +104,8 @@ The actual default value of this option depends on other field options:
103104
.. include:: /reference/forms/types/options/empty_data.rst.inc
104105
:start-after: DEFAULT_PLACEHOLDER
105106

107+
.. include:: /reference/forms/types/options/help.rst.inc
108+
106109
.. include:: /reference/forms/types/options/label.rst.inc
107110

108111
.. include:: /reference/forms/types/options/label_attr.rst.inc

‎reference/forms/types/currency.rst

Copy file name to clipboardExpand all lines: reference/forms/types/currency.rst
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ manually, but then you should just use the ``ChoiceType`` directly.
3131
| | - `data`_ |
3232
| | - `disabled`_ |
3333
| | - `empty_data`_ |
34+
| | - `help`_ |
3435
| | - `label`_ |
3536
| | - `label_attr`_ |
3637
| | - `label_format`_ |
@@ -92,6 +93,8 @@ The actual default value of this option depends on other field options:
9293
.. include:: /reference/forms/types/options/empty_data.rst.inc
9394
:start-after: DEFAULT_PLACEHOLDER
9495

96+
.. include:: /reference/forms/types/options/help.rst.inc
97+
9598
.. include:: /reference/forms/types/options/label.rst.inc
9699

97100
.. include:: /reference/forms/types/options/label_attr.rst.inc

‎reference/forms/types/date.rst

Copy file name to clipboardExpand all lines: reference/forms/types/date.rst
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ and can understand a number of different input formats via the `input`_ option.
3535
| Inherited | - `data`_ |
3636
| options | - `disabled`_ |
3737
| | - `error_mapping`_ |
38+
| | - `help`_ |
3839
| | - `inherit_data`_ |
3940
| | - `invalid_message`_ |
4041
| | - `invalid_message_parameters`_ |
@@ -206,6 +207,8 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:
206207

207208
.. include:: /reference/forms/types/options/error_mapping.rst.inc
208209

210+
.. include:: /reference/forms/types/options/help.rst.inc
211+
209212
.. include:: /reference/forms/types/options/inherit_data.rst.inc
210213

211214
.. include:: /reference/forms/types/options/invalid_message.rst.inc

‎reference/forms/types/dateinterval.rst

Copy file name to clipboardExpand all lines: reference/forms/types/dateinterval.rst
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ or an array (see `input`_).
3939
+----------------------+----------------------------------------------------------------------------------+
4040
| Inherited | - `data`_ |
4141
| options | - `disabled`_ |
42+
| | - `help`_ |
4243
| | - `inherit_data`_ |
4344
| | - `invalid_message`_ |
4445
| | - `invalid_message_parameters`_ |
@@ -307,6 +308,8 @@ These options inherit from the :doc:`form </reference/forms/types/form>` type:
307308

308309
.. include:: /reference/forms/types/options/disabled.rst.inc
309310

311+
.. include:: /reference/forms/types/options/help.rst.inc
312+
310313
.. include:: /reference/forms/types/options/inherit_data.rst.inc
311314

312315
.. include:: /reference/forms/types/options/invalid_message.rst.inc

‎reference/forms/types/datetime.rst

Copy file name to clipboardExpand all lines: reference/forms/types/datetime.rst
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ the data can be a ``DateTime`` object, a string, a timestamp or an array.
4242
+----------------------+-----------------------------------------------------------------------------+
4343
| Inherited | - `data`_ |
4444
| options | - `disabled`_ |
45+
| | - `help`_ |
4546
| | - `inherit_data`_ |
4647
| | - `invalid_message`_ |
4748
| | - `invalid_message_parameters`_ |
@@ -194,6 +195,8 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:
194195

195196
.. include:: /reference/forms/types/options/disabled.rst.inc
196197

198+
.. include:: /reference/forms/types/options/help.rst.inc
199+
197200
.. include:: /reference/forms/types/options/inherit_data.rst.inc
198201

199202
.. include:: /reference/forms/types/options/invalid_message.rst.inc

‎reference/forms/types/email.rst

Copy file name to clipboardExpand all lines: reference/forms/types/email.rst
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ The ``EmailType`` field is a text field that is rendered using the HTML5
1515
| | - `empty_data`_ |
1616
| | - `error_bubbling`_ |
1717
| | - `error_mapping`_ |
18+
| | - `help`_ |
1819
| | - `label`_ |
1920
| | - `label_attr`_ |
2021
| | - `label_format`_ |
@@ -48,6 +49,8 @@ The default value is ``''`` (the empty string).
4849

4950
.. include:: /reference/forms/types/options/error_mapping.rst.inc
5051

52+
.. include:: /reference/forms/types/options/help.rst.inc
53+
5154
.. include:: /reference/forms/types/options/label.rst.inc
5255

5356
.. include:: /reference/forms/types/options/label_attr.rst.inc

‎reference/forms/types/entity.rst

Copy file name to clipboardExpand all lines: reference/forms/types/entity.rst
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ objects from the database.
4141
| | - `empty_data`_ |
4242
| | - `error_bubbling`_ |
4343
| | - `error_mapping`_ |
44+
| | - `help`_ |
4445
| | - `label`_ |
4546
| | - `label_attr`_ |
4647
| | - `label_format`_ |
@@ -306,6 +307,8 @@ The actual default value of this option depends on other field options:
306307

307308
.. include:: /reference/forms/types/options/error_mapping.rst.inc
308309

310+
.. include:: /reference/forms/types/options/help.rst.inc
311+
309312
.. include:: /reference/forms/types/options/label.rst.inc
310313

311314
.. include:: /reference/forms/types/options/label_attr.rst.inc

‎reference/forms/types/file.rst

Copy file name to clipboardExpand all lines: reference/forms/types/file.rst
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ The ``FileType`` represents a file input in your form.
1818
| Inherited | - `disabled`_ |
1919
| options | - `error_bubbling`_ |
2020
| | - `error_mapping`_ |
21+
| | - `help`_ |
2122
| | - `label`_ |
2223
| | - `label_attr`_ |
2324
| | - `label_format`_ |
@@ -124,6 +125,8 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:
124125

125126
.. include:: /reference/forms/types/options/error_mapping.rst.inc
126127

128+
.. include:: /reference/forms/types/options/help.rst.inc
129+
127130
.. include:: /reference/forms/types/options/label.rst.inc
128131

129132
.. include:: /reference/forms/types/options/label_attr.rst.inc

‎reference/forms/types/form.rst

Copy file name to clipboardExpand all lines: reference/forms/types/form.rst
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ on all types for which ``FormType`` is the parent.
1919
| | - `error_bubbling`_ |
2020
| | - `error_mapping`_ |
2121
| | - `extra_fields_message`_ |
22+
| | - `help`_ |
2223
| | - `inherit_data`_ |
2324
| | - `invalid_message`_ |
2425
| | - `invalid_message_parameters`_ |
@@ -98,6 +99,8 @@ The actual default value of this option depends on other field options:
9899

99100
.. include:: /reference/forms/types/options/extra_fields_message.rst.inc
100101

102+
.. include:: /reference/forms/types/options/help.rst.inc
103+
101104
.. include:: /reference/forms/types/options/inherit_data.rst.inc
102105

103106
.. include:: /reference/forms/types/options/invalid_message.rst.inc

‎reference/forms/types/integer.rst

Copy file name to clipboardExpand all lines: reference/forms/types/integer.rst
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ integers. By default, all non-integer values (e.g. 6.78) will round down
2727
| | - `empty_data`_ |
2828
| | - `error_bubbling`_ |
2929
| | - `error_mapping`_ |
30+
| | - `help`_ |
3031
| | - `invalid_message`_ |
3132
| | - `invalid_message_parameters`_ |
3233
| | - `label`_ |
@@ -110,6 +111,8 @@ The default value is ``''`` (the empty string).
110111

111112
.. include:: /reference/forms/types/options/error_mapping.rst.inc
112113

114+
.. include:: /reference/forms/types/options/help.rst.inc
115+
113116
.. include:: /reference/forms/types/options/invalid_message.rst.inc
114117

115118
.. include:: /reference/forms/types/options/invalid_message_parameters.rst.inc

‎reference/forms/types/language.rst

Copy file name to clipboardExpand all lines: reference/forms/types/language.rst
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ manually, but then you should just use the ``ChoiceType`` directly.
4141
| | - `data`_ |
4242
| | - `disabled`_ |
4343
| | - `empty_data`_ |
44+
| | - `help`_ |
4445
| | - `label`_ |
4546
| | - `label_attr`_ |
4647
| | - `label_format`_ |
@@ -105,6 +106,8 @@ The actual default value of this option depends on other field options:
105106
.. include:: /reference/forms/types/options/empty_data.rst.inc
106107
:start-after: DEFAULT_PLACEHOLDER
107108

109+
.. include:: /reference/forms/types/options/help.rst.inc
110+
108111
.. include:: /reference/forms/types/options/label.rst.inc
109112

110113
.. include:: /reference/forms/types/options/label_attr.rst.inc

0 commit comments

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