From 525da155b96400e924b0e9429bb52ce314bc4b66 Mon Sep 17 00:00:00 2001 From: Simone Fumagalli Date: Thu, 27 Oct 2016 10:50:40 +0200 Subject: [PATCH 1/2] A bracket was missed --- reference/forms/types/choice.rst | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/reference/forms/types/choice.rst b/reference/forms/types/choice.rst index 1874fe700f6..4cae8143bee 100644 --- a/reference/forms/types/choice.rst +++ b/reference/forms/types/choice.rst @@ -131,18 +131,19 @@ You can easily "group" options in a select by passing a multi-dimensional choice use Symfony\Component\Form\Extension\Core\Type\ChoiceType; // ... - + $builder->add('stockStatus', ChoiceType::class, [ - 'choices' => [ - 'Main Statuses' => [ - 'Yes' => 'stock_yes', - 'No' => 'stock_no', + 'choices' => [ + 'Main Statuses' => [ + 'Yes' => 'stock_yes', + 'No' => 'stock_no', + ], + 'Out of Stock Statuses' => [ + 'Backordered' => 'stock_backordered', + 'Discontinued' => 'stock_discontinued', + ] ], - 'Out of Stock Statuses' => [ - 'Backordered' => 'stock_backordered', - 'Discontinued' => 'stock_discontinued', - ] - ], + ] ); .. image:: /_images/reference/form/choice-example4.png From 7184c34566c76d0e5d8f64dd4ad798e8f2ba61e8 Mon Sep 17 00:00:00 2001 From: Simone Fumagalli Date: Fri, 28 Oct 2016 14:41:31 +0200 Subject: [PATCH 2/2] Fixed CS --- reference/forms/types/choice.rst | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/reference/forms/types/choice.rst b/reference/forms/types/choice.rst index 4cae8143bee..285c54ef251 100644 --- a/reference/forms/types/choice.rst +++ b/reference/forms/types/choice.rst @@ -131,20 +131,19 @@ You can easily "group" options in a select by passing a multi-dimensional choice use Symfony\Component\Form\Extension\Core\Type\ChoiceType; // ... - - $builder->add('stockStatus', ChoiceType::class, [ - 'choices' => [ - 'Main Statuses' => [ - 'Yes' => 'stock_yes', - 'No' => 'stock_no', - ], - 'Out of Stock Statuses' => [ - 'Backordered' => 'stock_backordered', - 'Discontinued' => 'stock_discontinued', - ] - ], - ] - ); + + $builder->add('stockStatus', ChoiceType::class, array( + 'choices' => array( + 'Main Statuses' => array( + 'Yes' => 'stock_yes', + 'No' => 'stock_no', + ), + 'Out of Stock Statuses' => array( + 'Backordered' => 'stock_backordered', + 'Discontinued' => 'stock_discontinued', + ) + ), + )); .. image:: /_images/reference/form/choice-example4.png :align: center