Skip to content

Commit 591ed80

Browse files
committed
minor symfony#9071 Update choice.rst (jmangarret, weaverryan)
This PR was submitted for the 3.3 branch but it was merged into the 2.7 branch instead (closes symfony#9071). Discussion ---------- Update choice.rst FIX parametro atributo para añadir clase css Commits ------- f78b89e Adding the missing attr option to the ChoiceType 58a3043 Update choice.rst
2 parents 6fe874b + f78b89e commit 591ed80

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

reference/forms/types/choice.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ To use this field, you must specify *either* ``choices`` or ``choice_loader`` op
3131
| options | - `empty_data`_ |
3232
| | - `error_bubbling`_ |
3333
+-------------+------------------------------------------------------------------------------+
34-
| Inherited | - `by_reference`_ |
35-
| options | - `data`_ |
34+
| Inherited | - `attr`_ |
35+
| options | - `by_reference`_ |
36+
| | - `data`_ |
3637
| | - `disabled`_ |
3738
| | - `error_mapping`_ |
3839
| | - `inherit_data`_ |
@@ -105,6 +106,7 @@ method::
105106
'choice_attr' => function($category, $key, $index) {
106107
return ['class' => 'category_'.strtolower($category->getName())];
107108
},
109+
108110
'group_by' => function($category, $key, $index) {
109111
// randomly assign things into 2 groups
110112
return rand(0, 1) == 1 ? 'Group A' : 'Group B';
@@ -327,6 +329,8 @@ Inherited Options
327329
These options inherit from the :doc:`form </reference/forms/types/form>`
328330
type:
329331

332+
.. include:: /reference/forms/types/options/attr.rst.inc
333+
330334
.. include:: /reference/forms/types/options/by_reference.rst.inc
331335

332336
.. include:: /reference/forms/types/options/data.rst.inc

0 commit comments

Comments
 (0)