Skip to content

Fixes for 2.3 branch #4956

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 16 commits into from
8 changes: 4 additions & 4 deletions reference/forms/types/checkbox.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ checkbox Field Type
===================

Creates a single input checkbox. This should always be used for a field that
has a Boolean value: if the box is checked, the field will be set to true,
if the box is unchecked, the value will be set to false.
has a ``Boolean`` value: if the box is checked, the field will be set to ``true``,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

boolean is just a name (I would love to make it lowercase).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see #4671 :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should not be in backticks here. It is about the English adjective in this sentence

if the box is unchecked, the value will be set to ``false``.

+-------------+------------------------------------------------------------------------+
| Rendered as | ``input`` ``checkbox`` field |
Expand Down Expand Up @@ -37,8 +37,8 @@ Example Usage
.. code-block:: php

$builder->add('public', 'checkbox', array(
'label' => 'Show this entry publicly?',
'required' => false,
'label' => 'Show this entry publicly?',
'required' => false,
));

Field Options
Expand Down
14 changes: 7 additions & 7 deletions reference/forms/types/choice.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ user sees on the form (e.g. ``Male``).
.. code-block:: php

$builder->add('gender', 'choice', array(
'choices' => array('m' => 'Male', 'f' => 'Female'),
'required' => false,
'choices' => array('m' => 'Male', 'f' => 'Female'),
'required' => false,
));

By setting ``multiple`` to true, you can allow the user to choose multiple
Expand All @@ -62,12 +62,12 @@ of checkboxes depending on the ``expanded`` option:
.. code-block:: php

$builder->add('availability', 'choice', array(
'choices' => array(
'choices' => array(
'morning' => 'Morning',
'afternoon' => 'Afternoon',
'evening' => 'Evening',
),
'multiple' => true,
'multiple' => true,
));

You can also use the ``choice_list`` option, which takes an object that can
Expand All @@ -86,11 +86,11 @@ choices
**type**: ``array`` **default**: ``array()``

This is the most basic way to specify the choices that should be used
by this field. The ``choices`` option is an array, where the array key
by this field. The ``choices`` option is an ``array``, where the array key
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

is the item value and the array value is the item's label::

$builder->add('gender', 'choice', array(
'choices' => array('m' => 'Male', 'f' => 'Female')
'choices' => array('m' => 'Male', 'f' => 'Female'),
));

.. tip::
Expand All @@ -111,7 +111,7 @@ The ``choice_list`` option must be an instance of the ``ChoiceListInterface``.
For more advanced cases, a custom class that implements the interface
can be created to supply the choices.

With this option you can also allow float values to be selected as data.
With this option you can also allow ``float`` values to be selected as data.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here ...


.. code-block:: php

Expand Down
10 changes: 5 additions & 5 deletions reference/forms/types/entity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ option. The easiest way to use the option is as follows::

$builder->add('users', 'entity', array(
'class' => 'AcmeHelloBundle:User',
'query_builder' => function(EntityRepository $er) {
'query_builder' => function (EntityRepository $er) {
return $er->createQueryBuilder('u')
->orderBy('u.username', 'ASC');
},
Expand Down Expand Up @@ -131,7 +131,7 @@ This is a property path (e.g. ``author.name``) used to organize the
available choices in groups. It only works when rendered as a select tag
and does so by adding ``optgroup`` elements around options. Choices that do not
return a value for this property path are rendered directly under the
select tag, without a surrounding optgroup.
``select`` tag, without a surrounding ``optgroup``.

property
~~~~~~~~
Expand All @@ -140,7 +140,7 @@ property

This is the property that should be used for displaying the entities
as text in the HTML element. If left blank, the entity object will be
cast into a string and so must have a ``__toString()`` method.
cast into a ``string`` and so must have a ``__toString()`` method.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

an all other places where you used types (I'll stop commenting on them now)


.. note::

Expand All @@ -159,11 +159,11 @@ cast into a string and so must have a ``__toString()`` method.
query_builder
~~~~~~~~~~~~~

**type**: ``Doctrine\ORM\QueryBuilder`` or a Closure
**type**: ``Doctrine\ORM\QueryBuilder`` or a ``Closure``

If specified, this is used to query the subset of options (and their
order) that should be used for the field. The value of this option can
either be a ``QueryBuilder`` object or a Closure. If using a Closure,
either be a ``QueryBuilder`` object or a ``Closure``. If using a ``Closure``,
it should take a single argument, which is the ``EntityRepository`` of
the entity.

Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/money.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ the currency symbol that should be shown by the text box. Depending on
the currency - the currency symbol may be shown before or after the input
text field.

This can be any `3 letter ISO 4217 code`_. You can also set this to false to
This can be any `3 letter ISO 4217 code`_. You can also set this to ``false`` to
hide the currency symbol.

divisor
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/options/attr.rst.inc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
attr
~~~~

**type**: array **default**: Empty array
**type**: ``array`` **default**: ``array()``

If you want to add extra attributes to an HTML field representation
you can use the ``attr`` option. It's an associative array with HTML attributes
Expand Down
4 changes: 2 additions & 2 deletions reference/forms/types/options/by_reference.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ To explain this further, here's a simple example::
->add('email', 'email')
)

If ``by_reference`` is true, the following takes place behind the scenes
If ``by_reference`` is ``true``, the following takes place behind the scenes
when you call ``submit()`` (or ``handleRequest()``) on the form::

$article->setTitle('...');
Expand All @@ -28,7 +28,7 @@ when you call ``submit()`` (or ``handleRequest()``) on the form::

Notice that ``setAuthor()`` is not called. The author is modified by reference.

If you set ``by_reference`` to false, submitting looks like this::
If you set ``by_reference`` to ``false``, submitting looks like this::

$article->setTitle('...');
$author = $article->getAuthor();
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/options/cascade_validation.rst.inc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cascade_validation
~~~~~~~~~~~~~~~~~~

**type**: Boolean **default**: false
**type**: ``Boolean`` **default**: ``false``

Set this option to ``true`` to force validation on embedded form types.
For example, if you have a ``ProductType`` with an embedded ``CategoryType``,
Expand Down
4 changes: 2 additions & 2 deletions reference/forms/types/options/expanded.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ expanded

**type**: ``Boolean`` **default**: ``false``

If set to true, radio buttons or checkboxes will be rendered (depending
on the ``multiple`` value). If false, a select element will be rendered.
If set to ``true``, radio buttons or checkboxes will be rendered (depending
on the ``multiple`` value). If ``false``, a ``select`` element will be rendered.
2 changes: 1 addition & 1 deletion reference/forms/types/options/label.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ label

**type**: ``string`` **default**: The label is "guessed" from the field name

Sets the label that will be used when rendering the field. Setting to false
Sets the label that will be used when rendering the field. Setting to ``false``
will suppress the label. The label can also be directly set inside the template:

.. configuration-block::
Expand Down
6 changes: 3 additions & 3 deletions reference/forms/types/options/multiple.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ multiple

**type**: ``Boolean`` **default**: ``false``

If true, the user will be able to select multiple options (as opposed
If ``true``, the user will be able to select multiple options (as opposed
to choosing just one option). Depending on the value of the ``expanded``
option, this will render either a select tag or checkboxes if true and
a select tag or radio buttons if false. The returned value will be an array.
option, this will render either a ``select`` tag or checkboxes if ``true`` and
a ``select`` tag or radio buttons if ``false``. The returned value will be an ``array``.
2 changes: 1 addition & 1 deletion reference/forms/types/options/preferred_choices.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ to the top, with a visual separator between it and the rest of the options::
));

Note that preferred choices are only meaningful when rendering as a ``select``
element (i.e. ``expanded`` is false). The preferred choices and normal choices
element (i.e. ``expanded`` is ``false``). The preferred choices and normal choices
are separated visually by a set of dotted lines (i.e. ``-------------------``).
This can be customized when rendering the field:

Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/options/read_only.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ read_only

**type**: ``Boolean`` **default**: ``false``

If this option is true, the field will be rendered with the ``readonly``
If this option is ``true``, the field will be rendered with the ``readonly``
attribute so that the field is not editable.
2 changes: 1 addition & 1 deletion reference/forms/types/options/required.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ required

**type**: ``Boolean`` **default**: ``true``

If true, an `HTML5 required attribute`_ will be rendered. The corresponding
If ``true``, an `HTML5 required attribute`_ will be rendered. The corresponding
``label`` will also render with a ``required`` class.

This is superficial and independent from validation. At best, if you let Symfony
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/options/trim.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ trim

**type**: ``Boolean`` **default**: ``true``

If true, the whitespace of the submitted string value will be stripped
If ``true``, the whitespace of the submitted string value will be stripped
via the ``trim()`` function when the data is bound. This guarantees that
if a value is submitted with extra whitespace, it will be removed before
the value is merged back onto the underlying object.
6 changes: 3 additions & 3 deletions reference/forms/types/password.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ always_empty

**type**: ``Boolean`` **default**: ``true``

If set to true, the field will *always* render blank, even if the corresponding
field has a value. When set to false, the password field will be rendered
If set to ``true``, the field will *always* render blank, even if the corresponding
field has a value. When set to ``false``, the password field will be rendered
with the ``value`` attribute set to its true value only upon submission.

Put simply, if for some reason you want to render your password field
*with* the password value already entered into the box, set this to false
*with* the password value already entered into the box, set this to ``false``
and submit the form.


Expand Down
4 changes: 2 additions & 2 deletions reference/forms/types/percent.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ type
**type**: ``string`` **default**: ``fractional``

This controls how your data is stored on your object. For example, a percentage
corresponding to "55%", might be stored as ``.55`` or ``55`` on your
corresponding to "``55%``", might be stored as ``.55`` or ``55`` on your
object. The two "types" handle these two cases:

* ``fractional``
Expand All @@ -63,7 +63,7 @@ object. The two "types" handle these two cases:
on form submit so that the decimal value is stored (``.55``);

* ``integer``
If your data is stored as an integer (e.g. 55), then use this option.
If your data is stored as an integer (e.g. ``55``), then use this option.
The raw value (``55``) is shown to the user and stored on your object.
Note that this only works for integer values.

Expand Down