File tree Expand file tree Collapse file tree 4 files changed +16
-6
lines changed Expand file tree Collapse file tree 4 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -189,19 +189,21 @@ to the user.
189189 $builder->add('gender', 'choice', array(
190190 // Shows "Male" to the user, returns "m" when selected
191191 'choices' => array('m' => 'Male', 'f' => 'Female'),
192+ // before 2.7, this options didn't actually exist, but the
193+ // behavior was equivalent to setting this to false in 2.7.
192194 'choices_as_values' => false,
193195 ));
194196
195- * Optional since 2.7::
197+ * Since 2.7::
196198
197199 $builder->add('gender', 'choice', array(
198200 // Shows "Male" to the user, returns "m" when selected
199201 'choices' => array('Male' => 'm', 'Female' => 'f'),
200202 'choices_as_values' => true,
201203 ));
202204
203- In Symfony 3.0, ``choices_as_values `` option will go away , but it's behavior will
204- always be used :
205+ In Symfony 3.0, the ``choices_as_values `` option doesn't exist , but the `` choice ``
206+ type behaves as if it were set to true :
205207
206208* Default for 3.0::
207209
Original file line number Diff line number Diff line change 171171
172172**type **: ``string `` | ``Doctrine\Common\Persistence\ObjectManager `` **default **: the default entity manager
173173
174- If specified, the specified entity manager will be used to load the choices
175- instead of the default entity manager.
174+ If specified, this entity manager will be used to load the choices
175+ instead of the `` default `` entity manager.
176176
177177
178178Overridden Options
Original file line number Diff line number Diff line change @@ -13,3 +13,11 @@ configure the value that will be sent in the API request).
1313
1414This can be a callable or a property path. See `choice_label`_ for similar usage.
1515If ``null`` is used, an incrementing integer is used as the name.
16+
17+ .. caution::
18+
19+ In Symfony 2.7, there was a small backwards-compatibility break with how the
20+ `value` attribute of options is generated. This is not a problem unless you
21+ rely on the option values in JavaScript. See `issue #14825`_ for details.
22+
23+ .. _`issue #14285`: https://github.com/symfony/symfony/pull/14825
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ Take the following example::
3232 },
3333 ));
3434
35- This groups the dates that are within 3 days into "Soon" and everyting else into
35+ This groups the dates that are within 3 days into "Soon" and everything else into
3636a "Later" group:
3737
3838.. image:: /images/reference/form/choice-example5.png
You can’t perform that action at this time.
0 commit comments