File tree 9 files changed +39
-0
lines changed
9 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -212,6 +212,8 @@ the ``Choice`` constraint behave like a ``NotChoice`` constraint.
212
212
213
213
.. include :: /reference/forms/types/options/placeholder.rst.inc
214
214
215
+ .. include :: /reference/forms/types/options/placeholder_attr.rst.inc
216
+
215
217
.. include :: /reference/forms/types/options/preferred_choices.rst.inc
216
218
217
219
Overridden Options
@@ -311,6 +313,8 @@ Field Variables
311
313
| placeholder | ``mixed `` | The empty value if not already in the list, otherwise |
312
314
| | | ``null ``. |
313
315
+----------------------------+--------------+-------------------------------------------------------------------+
316
+ | placeholder_attr | ``array `` | The value of the `placeholder_attr `_ option. |
317
+ +----------------------------+--------------+-------------------------------------------------------------------+
314
318
| choice_translation_domain | ``mixed `` | ``boolean ``, ``null `` or ``string `` to determine if the value |
315
319
| | | should be translated. |
316
320
+----------------------------+--------------+-------------------------------------------------------------------+
Original file line number Diff line number Diff line change @@ -81,6 +81,8 @@ These options inherit from the :doc:`ChoiceType </reference/forms/types/choice>`
81
81
82
82
.. include :: /reference/forms/types/options/placeholder.rst.inc
83
83
84
+ .. include :: /reference/forms/types/options/placeholder_attr.rst.inc
85
+
84
86
.. include :: /reference/forms/types/options/preferred_choices.rst.inc
85
87
86
88
.. include :: /reference/forms/types/options/choice_type_trim.rst.inc
Original file line number Diff line number Diff line change @@ -62,6 +62,8 @@ These options inherit from the :doc:`ChoiceType </reference/forms/types/choice>`
62
62
63
63
.. include :: /reference/forms/types/options/placeholder.rst.inc
64
64
65
+ .. include :: /reference/forms/types/options/placeholder_attr.rst.inc
66
+
65
67
.. include :: /reference/forms/types/options/preferred_choices.rst.inc
66
68
67
69
.. include :: /reference/forms/types/options/choice_type_trim.rst.inc
Original file line number Diff line number Diff line change @@ -256,6 +256,8 @@ Doctrine's Array Collection.
256
256
257
257
.. include :: /reference/forms/types/options/placeholder.rst.inc
258
258
259
+ .. include :: /reference/forms/types/options/placeholder_attr.rst.inc
260
+
259
261
``preferred_choices ``
260
262
~~~~~~~~~~~~~~~~~~~~~
261
263
Original file line number Diff line number Diff line change @@ -78,6 +78,8 @@ These options inherit from the :doc:`ChoiceType </reference/forms/types/choice>`
78
78
79
79
.. include :: /reference/forms/types/options/placeholder.rst.inc
80
80
81
+ .. include :: /reference/forms/types/options/placeholder_attr.rst.inc
82
+
81
83
.. include :: /reference/forms/types/options/preferred_choices.rst.inc
82
84
83
85
.. include :: /reference/forms/types/options/choice_type_trim.rst.inc
Original file line number Diff line number Diff line change @@ -98,6 +98,8 @@ These options inherit from the :doc:`ChoiceType </reference/forms/types/choice>`
98
98
99
99
.. include :: /reference/forms/types/options/placeholder.rst.inc
100
100
101
+ .. include :: /reference/forms/types/options/placeholder_attr.rst.inc
102
+
101
103
.. include :: /reference/forms/types/options/preferred_choices.rst.inc
102
104
103
105
.. include :: /reference/forms/types/options/choice_type_trim.rst.inc
Original file line number Diff line number Diff line change @@ -75,6 +75,8 @@ These options inherit from the :doc:`ChoiceType </reference/forms/types/choice>`
75
75
76
76
.. include :: /reference/forms/types/options/placeholder.rst.inc
77
77
78
+ .. include :: /reference/forms/types/options/placeholder_attr.rst.inc
79
+
78
80
.. include :: /reference/forms/types/options/preferred_choices.rst.inc
79
81
80
82
.. include :: /reference/forms/types/options/choice_type_trim.rst.inc
Original file line number Diff line number Diff line change
1
+ ``placeholder_attr``
2
+ ~~~~~~~~~~~~~~~~~~~~
3
+
4
+ **type**: ``array`` **default**: ``[]``
5
+
6
+ Use this to add additional HTML attributes to the placeholder choice::
7
+
8
+ use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
9
+ // ...
10
+
11
+ $builder->add('fruits', ChoiceType::class, [
12
+ // ...
13
+ 'placeholder' => '...',
14
+ 'placeholder_attr' => [
15
+ ['title' => 'Choose an option'],
16
+ ],
17
+ ]);
18
+
19
+ .. versionadded:: 6.3
20
+
21
+ The ``placeholder_attr`` option was introduced in Symfony 6.3.
Original file line number Diff line number Diff line change @@ -92,6 +92,8 @@ These options inherit from the :doc:`ChoiceType </reference/forms/types/choice>`
92
92
93
93
.. include :: /reference/forms/types/options/placeholder.rst.inc
94
94
95
+ .. include :: /reference/forms/types/options/placeholder_attr.rst.inc
96
+
95
97
.. include :: /reference/forms/types/options/preferred_choices.rst.inc
96
98
97
99
.. include :: /reference/forms/types/options/choice_type_trim.rst.inc
You can’t perform that action at this time.
0 commit comments