diff --git a/reference/forms/types/choice.rst b/reference/forms/types/choice.rst index 1874fe700f6..285c54ef251 100644 --- a/reference/forms/types/choice.rst +++ b/reference/forms/types/choice.rst @@ -132,18 +132,18 @@ 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' => [ + $builder->add('stockStatus', ChoiceType::class, array( + 'choices' => array( + 'Main Statuses' => array( 'Yes' => 'stock_yes', 'No' => 'stock_no', - ], - 'Out of Stock Statuses' => [ + ), + 'Out of Stock Statuses' => array( 'Backordered' => 'stock_backordered', 'Discontinued' => 'stock_discontinued', - ] - ], - ); + ) + ), + )); .. image:: /_images/reference/form/choice-example4.png :align: center