Skip to content

Commit

Permalink
tweaks thanks to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverryan committed Nov 11, 2015
1 parent 0ad7b18 commit 70f5e85
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
8 changes: 5 additions & 3 deletions reference/forms/types/choice.rst
Original file line number Diff line number Diff line change
Expand Up @@ -189,19 +189,21 @@ 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
'choices' => array('Male' => 'm', 'Female' => 'f'),
'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::

Expand Down
4 changes: 2 additions & 2 deletions reference/forms/types/entity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions reference/forms/types/options/choice_value.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion reference/forms/types/options/group_by.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 70f5e85

Please sign in to comment.