Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0ae6a4c

Browse filesBrowse files
committed
minor #7949 add missing choices_as_values options (xabbuh)
This PR was merged into the 2.7 branch. Discussion ---------- add missing choices_as_values options Commits ------- 899f148 add missing choices_as_values options
2 parents 9c02ada + 899f148 commit 0ae6a4c
Copy full SHA for 0ae6a4c

File tree

Expand file treeCollapse file tree

2 files changed

+9
-5
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+9
-5
lines changed

‎form/create_custom_field_type.rst

Copy file name to clipboardExpand all lines: form/create_custom_field_type.rst
+3-1Lines 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

Copy file name to clipboardExpand all lines: form/dynamic_form_modification.rst
+6-4Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.