@@ -19,7 +19,7 @@ To use this field, you must specify *either* ``choices`` or ``choice_loader`` op
1919| | - `choice_name `_ |
2020| | - `choice_translation_domain `_ |
2121| | - `choice_value `_ |
22- | | - `choices_as_values `_ |
22+ | | - `choices_as_values `_ (deprecated) |
2323| | - `expanded `_ |
2424| | - `group_by `_ |
2525| | - `multiple `_ |
@@ -167,8 +167,6 @@ is the item's label and the array value is the item's value::
167167
168168 $builder->add('inStock', ChoiceType::class, array(
169169 'choices' => array('In Stock' => true, 'Out of Stock' => false),
170- // always include this
171- 'choices_as_values' => true,
172170 ));
173171
174172.. include :: /reference/forms/types/options/choice_attr.rst.inc
@@ -195,39 +193,8 @@ would replace the ``choices`` option.
195193choices_as_values
196194~~~~~~~~~~~~~~~~~
197195
198- **type **: ``boolean `` **default **: false
199-
200- The ``choices_as_values `` option was added to keep backward compatibility with the
201- *old * way of handling the ``choices `` option. When set to ``false `` (or omitted),
202- the choice keys are used as the underlying value and the choice values are shown
203- to the user.
204-
205- * Before 2.7 (and deprecated now)::
206-
207- $builder->add('gender', 'choice', array(
208- // Shows "Male" to the user, returns "m" when selected
209- 'choices' => array('m' => 'Male', 'f' => 'Female'),
210- // before 2.7, this option didn't actually exist, but the
211- // behavior was equivalent to setting this to false in 2.7.
212- 'choices_as_values' => false,
213- ));
214-
215- * Since 2.7::
216-
217- $builder->add('gender', ChoiceType::class, array(
218- // Shows "Male" to the user, returns "m" when selected
219- 'choices' => array('Male' => 'm', 'Female' => 'f'),
220- 'choices_as_values' => true,
221- ));
222-
223- In Symfony 3.0, the ``choices_as_values `` option doesn't exist, but the ``choice ``
224- type behaves as if it were set to true:
225-
226- * Default for 3.0::
227-
228- $builder->add('gender', ChoiceType::class, array(
229- 'choices' => array('Male' => 'm', 'Female' => 'f'),
230- ));
196+ This option is deprecated and you should remove it from your 3.x projects (removing
197+ it will have *no * effect). For its purpose in 2.x, see the 2.7 documentation.
231198
232199.. include :: /reference/forms/types/options/expanded.rst.inc
233200
0 commit comments