Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions reference/forms/types/choice.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down