From 70f5e850feab99a5221ac07c8861040918c37b7a Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Tue, 10 Nov 2015 20:25:30 -0500 Subject: [PATCH] tweaks thanks to comments --- reference/forms/types/choice.rst | 8 +++++--- reference/forms/types/entity.rst | 4 ++-- reference/forms/types/options/choice_value.rst.inc | 8 ++++++++ reference/forms/types/options/group_by.rst.inc | 2 +- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/reference/forms/types/choice.rst b/reference/forms/types/choice.rst index 161708654f2..20d8f2af519 100644 --- a/reference/forms/types/choice.rst +++ b/reference/forms/types/choice.rst @@ -189,10 +189,12 @@ to the user. $builder->add('gender', 'choice', array( // Shows "Male" to the user, returns "m" when selected 'choices' => array('m' => 'Male', 'f' => 'Female'), + // before 2.7, this options didn't actually exist, but the + // behavior was equivalent to setting this to false in 2.7. 'choices_as_values' => false, )); -* Optional since 2.7:: +* Since 2.7:: $builder->add('gender', 'choice', array( // Shows "Male" to the user, returns "m" when selected @@ -200,8 +202,8 @@ to the user. 'choices_as_values' => true, )); -In Symfony 3.0, ``choices_as_values`` option will go away, but it's behavior will -always be used: +In Symfony 3.0, the ``choices_as_values`` option doesn't exist, but the ``choice`` +type behaves as if it were set to true: * Default for 3.0:: diff --git a/reference/forms/types/entity.rst b/reference/forms/types/entity.rst index 0f769b1ee51..01ce0f7862d 100644 --- a/reference/forms/types/entity.rst +++ b/reference/forms/types/entity.rst @@ -171,8 +171,8 @@ em **type**: ``string`` | ``Doctrine\Common\Persistence\ObjectManager`` **default**: the default entity manager -If specified, the specified entity manager will be used to load the choices -instead of the default entity manager. +If specified, this entity manager will be used to load the choices +instead of the ``default`` entity manager. Overridden Options diff --git a/reference/forms/types/options/choice_value.rst.inc b/reference/forms/types/options/choice_value.rst.inc index 653ce798b5d..f6574cf4de9 100644 --- a/reference/forms/types/options/choice_value.rst.inc +++ b/reference/forms/types/options/choice_value.rst.inc @@ -13,3 +13,11 @@ configure the value that will be sent in the API request). This can be a callable or a property path. See `choice_label`_ for similar usage. If ``null`` is used, an incrementing integer is used as the name. + +.. caution:: + + In Symfony 2.7, there was a small backwards-compatibility break with how the + `value` attribute of options is generated. This is not a problem unless you + rely on the option values in JavaScript. See `issue #14825`_ for details. + +.. _`issue #14285`: https://github.com/symfony/symfony/pull/14825 diff --git a/reference/forms/types/options/group_by.rst.inc b/reference/forms/types/options/group_by.rst.inc index 2cb16818d29..9147a0a09bf 100644 --- a/reference/forms/types/options/group_by.rst.inc +++ b/reference/forms/types/options/group_by.rst.inc @@ -32,7 +32,7 @@ Take the following example:: }, )); -This groups the dates that are within 3 days into "Soon" and everyting else into +This groups the dates that are within 3 days into "Soon" and everything else into a "Later" group: .. image:: /images/reference/form/choice-example5.png