Skip to content

Commit 899f148

Browse files
committed
add missing choices_as_values options
1 parent 9c02ada commit 899f148

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

form/create_custom_field_type.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ for form fields, which is ``<BundleName>\Form\Type``. Make sure the field extend
3535
'Standard Shipping' => 'standard',
3636
'Expedited Shipping' => 'expedited',
3737
'Priority Shipping' => 'priority',
38-
)
38+
),
39+
'choices_as_values' => true,
3940
));
4041
}
4142

@@ -395,6 +396,7 @@ method to ``ShippingType``, which receives the shipping configuration::
395396
{
396397
$resolver->setDefaults(array(
397398
'choices' => array_flip($this->shippingOptions),
399+
'choices_as_values' => true,
398400
));
399401
}
400402

form/dynamic_form_modification.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -490,9 +490,10 @@ sport like this::
490490
$positions = null === $sport ? array() : $sport->getAvailablePositions();
491491

492492
$form->add('position', 'entity', array(
493-
'class' => 'AppBundle:Position',
493+
'class' => 'AppBundle:Position',
494494
'placeholder' => '',
495-
'choices' => $positions,
495+
'choices' => $positions,
496+
'choices_as_values' => true,
496497
));
497498
}
498499
);
@@ -553,9 +554,10 @@ The type would now look like::
553554
$positions = null === $sport ? array() : $sport->getAvailablePositions();
554555

555556
$form->add('position', 'entity', array(
556-
'class' => 'AppBundle:Position',
557+
'class' => 'AppBundle:Position',
557558
'placeholder' => '',
558-
'choices' => $positions,
559+
'choices' => $positions,
560+
'choices_as_values' => true,
559561
));
560562
};
561563

0 commit comments

Comments
 (0)