diff --git a/reference/forms/types/choice.rst b/reference/forms/types/choice.rst index d35372cc707..9db339fe781 100644 --- a/reference/forms/types/choice.rst +++ b/reference/forms/types/choice.rst @@ -30,8 +30,9 @@ To use this field, you must specify *either* ``choices`` or ``choice_loader`` op | options | - `empty_data`_ | | | - `error_bubbling`_ | +-------------+------------------------------------------------------------------------------+ -| Inherited | - `by_reference`_ | -| options | - `data`_ | +| Inherited | - `attr`_ | +| options | - `by_reference`_ | +| | - `data`_ | | | - `disabled`_ | | | - `error_mapping`_ | | | - `inherit_data`_ | @@ -99,6 +100,7 @@ method:: 'choice_attr' => function($category, $key, $index) { return ['class' => 'category_'.strtolower($category->getName())]; }, + 'group_by' => function($category, $key, $index) { // randomly assign things into 2 groups return rand(0, 1) == 1 ? 'Group A' : 'Group B'; @@ -263,6 +265,8 @@ Inherited Options These options inherit from the :doc:`FormType `: +.. include:: /reference/forms/types/options/attr.rst.inc + .. include:: /reference/forms/types/options/by_reference.rst.inc .. include:: /reference/forms/types/options/data.rst.inc