Skip to content

Commit 03fdc5b

Browse files
committed
Reviewed form type options includes
1 parent ffe2b15 commit 03fdc5b

30 files changed

+105
-92
lines changed

reference/forms/types/options/action.rst.inc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ action
66

77
**type**: ``string`` **default**: empty string
88

9-
This option specifies where to send the form's data on submission (usually a
10-
URI). Its value is rendered as the ``action`` attribute of the ``form``
11-
element. An empty value is considered a same-document reference, i.e. the form
12-
will be submitted to the same URI that rendered the form.
9+
This option specifies where to send the form's data on submission (usually
10+
a URI). Its value is rendered as the ``action`` attribute of the ``form``
11+
element. An empty value is considered a same-document reference, i.e. the
12+
form will be submitted to the same URI that rendered the form.

reference/forms/types/options/auto_initialize.rst.inc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ auto_initialize
44
**type**: ``boolean`` **default**: ``true``
55

66
An internal option: sets whether the form should be initialized automatically.
7-
For all fields, this option should only be ``true`` for root forms. You won't
8-
need to change this option and probably won't need to worry about it.
7+
For all fields, this option should only be ``true`` for root forms. You
8+
won't need to change this option and probably won't need to worry about
9+
it.

reference/forms/types/options/block_name.rst.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
block_name
2-
~~~~~~~~~~~
2+
~~~~~~~~~~
33

44
**type**: ``string`` **default**: the form's name (see :ref:`Knowing which
55
block to customize <cookbook-form-customization-sidebar>`)

reference/forms/types/options/button_label.rst.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ label
33

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

6-
Sets the label that will be displayed on the button. The label can also be
7-
directly set inside the template:
6+
Sets the label that will be displayed on the button. The label can also
7+
be directly set inside the template:
88

99
.. configuration-block::
1010

reference/forms/types/options/by_reference.rst.inc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ So, all that ``by_reference=false`` really does is force the framework to
4040
call the setter on the parent object.
4141

4242
Similarly, if you're using the :doc:`collection</reference/forms/types/collection>`
43-
form type where your underlying collection data is an object (like with Doctrine's
44-
``ArrayCollection``), then ``by_reference`` must be set to ``false`` if you
45-
need the adder and remover (e.g. ``addAuthor()`` and ``removeAuthor()``) to be called.
43+
form type where your underlying collection data is an object (like with
44+
Doctrine's ``ArrayCollection``), then ``by_reference`` must be set to ``false``
45+
if you need the adder and remover (e.g. ``addAuthor()`` and ``removeAuthor()``)
46+
to be called.

reference/forms/types/options/cascade_validation.rst.inc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ the data from ``CategoryType`` to also be validated.
1111
.. tip::
1212

1313
Instead of using this option, it is recommended that you use the ``Valid``
14-
constraint in your model to force validation on a child object stored on
15-
a property. This cascades only the validation but not the use of the
16-
``validation_group`` option on child forms. You can read more about this
17-
in the section about :ref:`Embedding a Single Object <forms-embedding-single-object>`.
14+
constraint in your model to force validation on a child object stored
15+
on a property. This cascades only the validation but not the use of
16+
the ``validation_group`` option on child forms. You can read more
17+
about this in the section about
18+
:ref:`Embedding a Single Object <forms-embedding-single-object>`.
1819

1920
.. include:: /reference/forms/types/options/_error_bubbling_hint.rst.inc

reference/forms/types/options/compound.rst.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ compound
33

44
**type**: ``boolean`` **default**: ``true``
55

6-
This option specifies if a form is compound. This is independent of whether the
7-
form actually has children. A form can be compound but not have any children
8-
at all (e.g. an empty collection form).
6+
This option specifies if a form is compound. This is independent of whether
7+
the form actually has children. A form can be compound but not have any
8+
children at all (e.g. an empty collection form).

reference/forms/types/options/data.rst.inc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ data
55

66
When you create a form, each field initially displays the value of the
77
corresponding property of the form's domain object (if an object is bound
8-
to the form). If you want to override the initial value for the form or just
9-
an individual field, you can set it in the data option::
8+
to the form). If you want to override the initial value for the form or
9+
just an individual field, you can set it in the data option::
1010

1111
$builder->add('token', 'hidden', array(
1212
'data' => 'abcdef',
1313
));
1414

1515
.. note::
1616

17-
The default values for form fields are taken directly from the
18-
underlying data structure (e.g. an entity or an array).
19-
The ``data`` option overrides this default value.
17+
The default values for form fields are taken directly from the underlying
18+
data structure (e.g. an entity or an array). The ``data`` option overrides
19+
this default value.

reference/forms/types/options/data_class.rst.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ data_class
33

44
**type**: ``string``
55

6-
This option is used to set the appropriate data mapper to be used by the form,
7-
so you can use it for any form field type which requires an object.
6+
This option is used to set the appropriate data mapper to be used by the
7+
form, so you can use it for any form field type which requires an object.
88

99
.. code-block:: php
1010

reference/forms/types/options/date_format.rst.inc

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ format
44
**type**: ``integer`` or ``string`` **default**: `IntlDateFormatter::MEDIUM`_
55
(or ``yyyy-MM-dd`` if `widget`_ is ``single_text``)
66

7-
Option passed to the ``IntlDateFormatter`` class, used to transform user input
8-
into the proper format. This is critical when the `widget`_ option is
9-
set to ``single_text``, and will define how the user will input the data.
7+
Option passed to the ``IntlDateFormatter`` class, used to transform user
8+
input into the proper format. This is critical when the `widget`_ option
9+
is set to ``single_text`` and will define how the user will input the data.
1010
By default, the format is determined based on the current user locale: meaning
11-
that *the expected format will be different for different users*. You
12-
can override it by passing the format as a string.
11+
that *the expected format will be different for different users*. You can
12+
override it by passing the format as a string.
1313

1414
For more information on valid formats, see `Date/Time Format Syntax`_::
1515

@@ -21,9 +21,10 @@ For more information on valid formats, see `Date/Time Format Syntax`_::
2121

2222
.. note::
2323

24-
If you want your field to be rendered as an HTML5 "date" field, you have to
25-
use a ``single_text`` widget with the ``yyyy-MM-dd`` format (the `RFC 3339`_
26-
format) which is the default value if you use the ``single_text`` widget.
24+
If you want your field to be rendered as an HTML5 "date" field, you
25+
have to use a ``single_text`` widget with the ``yyyy-MM-dd`` format
26+
(the `RFC 3339`_ format) which is the default value if you use the
27+
``single_text`` widget.
2728

2829
.. _`Date/Time Format Syntax`: http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax
2930
.. _`IntlDateFormatter::MEDIUM`: http://www.php.net/manual/en/class.intldateformatter.php#intl.intldateformatter-constants

reference/forms/types/options/date_input.rst.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ input
33

44
**type**: ``string`` **default**: ``datetime``
55

6-
The format of the *input* data - i.e. the format that the date is stored on
7-
your underlying object. Valid values are:
6+
The format of the *input* data - i.e. the format that the date is stored
7+
on your underlying object. Valid values are:
88

99
* ``string`` (e.g. ``2011-06-05``)
1010
* ``datetime`` (a ``DateTime`` object)
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
**type**: ``string`` **default**: ``choice``
22

3-
The basic way in which this field should be rendered. Can be one of the following:
3+
The basic way in which this field should be rendered. Can be one of the
4+
following:
45

56
* ``choice``: renders three select inputs. The order of the selects is defined
67
in the `format`_ option.
78

89
* ``text``: renders a three field input of type ``text`` (month, day, year).
910

10-
* ``single_text``: renders a single input of type ``date``. User's input is
11-
validated based on the `format`_ option.
11+
* ``single_text``: renders a single input of type ``date``. User's input
12+
is validated based on the `format`_ option.

reference/forms/types/options/disabled.rst.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ disabled
66

77
**type**: ``boolean`` **default**: ``false``
88

9-
If you don't want a user to modify the value of a field, you can set the disabled
10-
option to true. Any submitted value will be ignored.
9+
If you don't want a user to modify the value of a field, you can set the
10+
disabled option to true. Any submitted value will be ignored.

reference/forms/types/options/empty_data.rst.inc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ empty_data
33

44
**type**: ``mixed``
55

6-
.. This file should only be included with start-after or end-before that's set to
7-
this placeholder value. Its purpose is to let us include only part of this file.
6+
.. This file should only be included with start-after or end-before that's
7+
set to this placeholder value. Its purpose is to let us include only
8+
part of this file.
89

910
DEFAULT_PLACEHOLDER
1011

@@ -13,9 +14,7 @@ value is empty.
1314

1415
But you can customize this to your needs. For example, if you want the
1516
``gender`` choice field to be explicitly set to ``null`` when no value is
16-
selected, you can do it like this:
17-
18-
.. code-block:: php
17+
selected, you can do it like this::
1918

2019
$builder->add('gender', 'choice', array(
2120
'choices' => array(

reference/forms/types/options/empty_value.rst.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ empty_value
77

88
**type**: ``string`` or ``boolean``
99

10-
This option determines whether or not a special "empty" option (e.g. "Choose an option")
11-
will appear at the top of a select widget. This option only applies if the
12-
``multiple`` option is set to false.
10+
This option determines whether or not a special "empty" option (e.g. "Choose
11+
an option") will appear at the top of a select widget. This option only
12+
applies if the ``multiple`` option is set to false.
1313

1414
* Add an empty value with "Choose an option" as the text::
1515

reference/forms/types/options/error_mapping.rst.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ field so that it displays above it::
2828
Here are the rules for the left and the right side of the mapping:
2929

3030
* The left side contains property paths;
31-
* If the violation is generated on a property or method of a class, its path
32-
is simply ``propertyName``;
31+
* If the violation is generated on a property or method of a class, its
32+
path is simply ``propertyName``;
3333
* If the violation is generated on an entry of an ``array`` or ``ArrayAccess``
3434
object, the property path is ``[indexName]``;
3535
* You can construct nested property paths by concatenating them, separating

reference/forms/types/options/grouping.rst.inc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ grouping
33

44
**type**: ``integer`` **default**: ``false``
55

6-
This value is used internally as the ``NumberFormatter::GROUPING_USED`` value
7-
when using PHP's ``NumberFormatter`` class. Its documentation is non-existent,
8-
but it appears that if you set this to ``true``, numbers will be grouped with
9-
a comma or period (depending on your locale): ``12345.123`` would display
10-
as ``12,345.123``.
6+
This value is used internally as the ``NumberFormatter::GROUPING_USED``
7+
value when using PHP's ``NumberFormatter`` class. Its documentation is
8+
non-existent, but it appears that if you set this to ``true``, numbers will
9+
be grouped with a comma or period (depending on your locale): ``12345.123``
10+
would display as ``12,345.123``.

reference/forms/types/options/inherit_data.rst.inc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ multiple forms. See :doc:`/cookbook/form/inherit_data_option`.
1313

1414
.. caution::
1515

16-
When a field has the ``inherit_data`` option set, it uses the data of the
17-
parent form as is. This means that :doc:`Data Transformers </cookbook/form/data_transformers>`
18-
won't be applied to that field.
16+
When a field has the ``inherit_data`` option set, it uses the data of
17+
the parent form as is. This means that
18+
:doc:`Data Transformers </cookbook/form/data_transformers>` won't be
19+
applied to that field.

reference/forms/types/options/invalid_message.rst.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ a :doc:`time</reference/forms/types/time>` field that cannot be converted
1111
into a real time or if the user enters a string (e.g. ``apple``) into a
1212
number field.
1313

14-
Normal (business logic) validation (such as when setting a minimum length for
15-
a field) should be set using validation messages with your validation rules
16-
(:ref:`reference<book-validation-constraint-configuration>`).
14+
Normal (business logic) validation (such as when setting a minimum length
15+
for a field) should be set using validation messages with your validation
16+
rules (:ref:`reference<book-validation-constraint-configuration>`).

reference/forms/types/options/invalid_message_parameters.rst.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ to that option and including the variables in this option::
99

1010
$builder->add('some_field', 'some_type', array(
1111
// ...
12-
'invalid_message' => 'You entered an invalid value - it should include %num% letters',
12+
'invalid_message' => 'You entered an invalid value, it should include %num% letters',
1313
'invalid_message_parameters' => array('%num%' => 6),
1414
));

reference/forms/types/options/label_attr.rst.inc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@ label_attr
33

44
**type**: ``array`` **default**: ``array()``
55

6-
Sets the HTML attributes for the ``<label>`` element, which will be used when
7-
rendering the label for the field. It's an associative array with HTML attribute
8-
as a key. This attributes can also be directly set inside the template:
6+
Sets the HTML attributes for the ``<label>`` element, which will be used
7+
when rendering the label for the field. It's an associative array with HTML
8+
attribute as a key. This attributes can also be directly set inside the
9+
template:
910

1011
.. configuration-block::
1112

1213
.. code-block:: jinja
1314

14-
{{ form_label(form.name, 'Your name', {'label_attr': {'class': 'CUSTOM_LABEL_CLASS'}}) }}
15+
{{ form_label(form.name, 'Your name', {
16+
'label_attr': {'class': 'CUSTOM_LABEL_CLASS'}
17+
}) }}
1518

1619
.. code-block:: php
1720

reference/forms/types/options/mapped.rst.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ mapped
33

44
**type**: ``boolean`` **default**: ``true``
55

6-
If you wish the field to be ignored when reading or writing to the object, you
7-
can set the ``mapped`` option to ``false``.
6+
If you wish the field to be ignored when reading or writing to the object,
7+
you can set the ``mapped`` option to ``false``.

reference/forms/types/options/method.rst.inc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ method
77
**type**: ``string`` **default**: ``POST``
88

99
This option specifies the HTTP method used to submit the form's data. Its
10-
value is rendered as the ``method`` attribute of the ``form`` element and is
11-
used to decide whether to process the form submission in the
10+
value is rendered as the ``method`` attribute of the ``form`` element and
11+
is used to decide whether to process the form submission in the
1212
``handleRequest()`` method after submission. Possible values are:
1313
1414
* POST
@@ -26,8 +26,8 @@ used to decide whether to process the form submission in the
2626

2727
.. note::
2828

29-
The PATCH method allows submitting partial data. In other words, if the
30-
submitted form data is missing certain fields, those will be ignored
29+
The PATCH method allows submitting partial data. In other words, if
30+
the submitted form data is missing certain fields, those will be ignored
3131
and the default values (if any) will be used. With all other HTTP methods,
32-
if the submitted form data is missing some fields, those fields are set
33-
to ``null``.
32+
if the submitted form data is missing some fields, those fields are
33+
set to ``null``.

reference/forms/types/options/pattern.rst.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ pattern
33

44
**type**: ``string`` **default**: ``null``
55

6-
This adds an HTML5 ``pattern`` attribute to restrict the field input by a
7-
given regular expression.
6+
This adds an HTML5 ``pattern`` attribute to restrict the field input by
7+
a given regular expression.
88

99
.. caution::
1010

reference/forms/types/options/post_max_size_message.rst.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ post_max_size_message
33

44
**type**: ``string`` **default**: ``The uploaded file was too large. Please try to upload a smaller file.``
55

6-
This is the validation error message that's used if submitted POST form data
7-
exceeds ``php.ini``'s ``post_max_size`` directive. The ``{{ max }}``
6+
This is the validation error message that's used if submitted POST form
7+
data exceeds ``php.ini``'s ``post_max_size`` directive. The ``{{ max }}``
88
placeholder can be used to display the allowed size.
99

1010
.. note::

reference/forms/types/options/preferred_choices.rst.inc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ preferred_choices
44
**type**: ``array`` **default**: ``array()``
55

66
If this option is specified, then a sub-set of all of the options will be
7-
moved to the top of the select menu. The following would move the "Baz" option
8-
to the top, with a visual separator between it and the rest of the options::
7+
moved to the top of the select menu. The following would move the "Baz"
8+
option to the top, with a visual separator between it and the rest of the
9+
options::
910

1011
$builder->add('foo_choices', 'choice', array(
1112
'choices' => array('foo' => 'Foo', 'bar' => 'Bar', 'baz' => 'Baz'),
@@ -25,4 +26,6 @@ This can be customized when rendering the field:
2526

2627
.. code-block:: php
2728

28-
<?php echo $view['form']->widget($form['foo_choices'], array('separator' => '=====')) ?>
29+
<?php echo $view['form']->widget($form['foo_choices'], array(
30+
'separator' => '====='
31+
)) ?>

reference/forms/types/options/property_path.rst.inc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ property_path
33

44
**type**: ``any`` **default**: ``the field's name``
55
6-
Fields display a property value of the form's domain object by default. When
7-
the form is submitted, the submitted value is written back into the object.
6+
Fields display a property value of the form's domain object by default.
7+
When the form is submitted, the submitted value is written back into the
8+
object.
89

9-
If you want to override the property that a field reads from and writes to,
10-
you can set the ``property_path`` option. Its default value is the field's
10+
If you want to override the property that a field reads from and writes
11+
to, you can set the ``property_path`` option. Its default value is the field's
1112
name.
1213
1314
If you wish the field to be ignored when reading or writing to the object

reference/forms/types/options/required.rst.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ required
66
If true, an `HTML5 required attribute`_ will be rendered. The corresponding
77
``label`` will also render with a ``required`` class.
88

9-
This is superficial and independent from validation. At best, if you let Symfony
10-
guess your field type, then the value of this option will be guessed from
11-
your validation information.
9+
This is superficial and independent from validation. At best, if you let
10+
Symfony guess your field type, then the value of this option will be guessed
11+
from your validation information.
1212

1313
.. note::
1414

reference/forms/types/options/trim.rst.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ trim
44
**type**: ``boolean`` **default**: ``true``
55

66
If true, the whitespace of the submitted string value will be stripped
7-
via the :phpfunction:`trim` function when the data is bound. This guarantees that
8-
if a value is submitted with extra whitespace, it will be removed before
7+
via the :phpfunction:`trim` function when the data is bound. This guarantees
8+
that if a value is submitted with extra whitespace, it will be removed before
99
the value is merged back onto the underlying object.

0 commit comments

Comments
 (0)