From 6aa2ca7d88d7a2ca4c7caa66876780155eb6e241 Mon Sep 17 00:00:00 2001 From: jmangarret Date: Wed, 17 Jan 2018 11:06:25 -0500 Subject: [PATCH 1/2] Update choice.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FIX parametro atributo para aƱadir clase css --- reference/forms/types/choice.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reference/forms/types/choice.rst b/reference/forms/types/choice.rst index d35372cc707..8bb644fb8a5 100644 --- a/reference/forms/types/choice.rst +++ b/reference/forms/types/choice.rst @@ -99,6 +99,10 @@ method:: 'choice_attr' => function($category, $key, $index) { return ['class' => 'category_'.strtolower($category->getName())]; }, + //Version 3.3 no funciona choice_attr. + //Lo correcto es + //'attr' => array('class' => 'form-control') + 'group_by' => function($category, $key, $index) { // randomly assign things into 2 groups return rand(0, 1) == 1 ? 'Group A' : 'Group B'; From 0e73bada8d30710e551028bd985b7754d87d1f10 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Thu, 18 Jan 2018 15:58:12 -0500 Subject: [PATCH 2/2] Adding the missing attr option to the ChoiceType --- reference/forms/types/choice.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/reference/forms/types/choice.rst b/reference/forms/types/choice.rst index 8bb644fb8a5..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,9 +100,6 @@ method:: 'choice_attr' => function($category, $key, $index) { return ['class' => 'category_'.strtolower($category->getName())]; }, - //Version 3.3 no funciona choice_attr. - //Lo correcto es - //'attr' => array('class' => 'form-control') 'group_by' => function($category, $key, $index) { // randomly assign things into 2 groups @@ -267,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