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.
189
189
$builder->add('gender', 'choice', array(
190
190
// Shows "Male" to the user, returns "m" when selected
191
191
'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.
192
194
'choices_as_values' => false,
193
195
));
194
196
195
- * Optional since 2.7::
197
+ * Since 2.7::
196
198
197
199
$builder->add('gender', 'choice', array(
198
200
// Shows "Male" to the user, returns "m" when selected
199
201
'choices' => array('Male' => 'm', 'Female' => 'f'),
200
202
'choices_as_values' => true,
201
203
));
202
204
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 :
205
207
206
208
* Default for 3.0::
207
209
Original file line number Diff line number Diff line change 171
171
172
172
**type **: ``string `` | ``Doctrine\Common\Persistence\ObjectManager `` **default **: the default entity manager
173
173
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.
176
176
177
177
178
178
Overridden 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).
13
13
14
14
This can be a callable or a property path. See `choice_label`_ for similar usage.
15
15
If ``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::
32
32
},
33
33
));
34
34
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
36
36
a "Later" group:
37
37
38
38
.. image:: /images/reference/form/choice-example5.png
You can’t perform that action at this time.
0 commit comments