From 03fdc5b4d23d724425239249d9b2d283e61fe592 Mon Sep 17 00:00:00 2001 From: WouterJ Date: Sat, 16 May 2015 12:48:11 +0200 Subject: [PATCH 1/2] Reviewed form type options includes --- reference/forms/types/options/action.rst.inc | 8 ++++---- .../forms/types/options/auto_initialize.rst.inc | 5 +++-- .../forms/types/options/block_name.rst.inc | 2 +- .../forms/types/options/button_label.rst.inc | 4 ++-- .../forms/types/options/by_reference.rst.inc | 7 ++++--- .../types/options/cascade_validation.rst.inc | 9 +++++---- reference/forms/types/options/compound.rst.inc | 6 +++--- reference/forms/types/options/data.rst.inc | 10 +++++----- .../forms/types/options/data_class.rst.inc | 4 ++-- .../forms/types/options/date_format.rst.inc | 17 +++++++++-------- .../forms/types/options/date_input.rst.inc | 4 ++-- .../options/date_widget_description.rst.inc | 7 ++++--- reference/forms/types/options/disabled.rst.inc | 4 ++-- .../forms/types/options/empty_data.rst.inc | 9 ++++----- .../forms/types/options/empty_value.rst.inc | 6 +++--- .../forms/types/options/error_mapping.rst.inc | 4 ++-- reference/forms/types/options/grouping.rst.inc | 10 +++++----- .../forms/types/options/inherit_data.rst.inc | 7 ++++--- .../forms/types/options/invalid_message.rst.inc | 6 +++--- .../options/invalid_message_parameters.rst.inc | 2 +- .../forms/types/options/label_attr.rst.inc | 11 +++++++---- reference/forms/types/options/mapped.rst.inc | 4 ++-- reference/forms/types/options/method.rst.inc | 12 ++++++------ reference/forms/types/options/pattern.rst.inc | 4 ++-- .../types/options/post_max_size_message.rst.inc | 4 ++-- .../types/options/preferred_choices.rst.inc | 9 ++++++--- .../forms/types/options/property_path.rst.inc | 9 +++++---- reference/forms/types/options/required.rst.inc | 6 +++--- reference/forms/types/options/trim.rst.inc | 4 ++-- .../forms/types/options/view_timezone.rst.inc | 3 ++- 30 files changed, 105 insertions(+), 92 deletions(-) diff --git a/reference/forms/types/options/action.rst.inc b/reference/forms/types/options/action.rst.inc index 7cfcadae101..dcc557a717f 100644 --- a/reference/forms/types/options/action.rst.inc +++ b/reference/forms/types/options/action.rst.inc @@ -6,7 +6,7 @@ action **type**: ``string`` **default**: empty string -This option specifies where to send the form's data on submission (usually a -URI). Its value is rendered as the ``action`` attribute of the ``form`` -element. An empty value is considered a same-document reference, i.e. the form -will be submitted to the same URI that rendered the form. +This option specifies where to send the form's data on submission (usually +a URI). Its value is rendered as the ``action`` attribute of the ``form`` +element. An empty value is considered a same-document reference, i.e. the +form will be submitted to the same URI that rendered the form. diff --git a/reference/forms/types/options/auto_initialize.rst.inc b/reference/forms/types/options/auto_initialize.rst.inc index 4accfd816ba..ab42f333438 100644 --- a/reference/forms/types/options/auto_initialize.rst.inc +++ b/reference/forms/types/options/auto_initialize.rst.inc @@ -4,5 +4,6 @@ auto_initialize **type**: ``boolean`` **default**: ``true`` An internal option: sets whether the form should be initialized automatically. -For all fields, this option should only be ``true`` for root forms. You won't -need to change this option and probably won't need to worry about it. +For all fields, this option should only be ``true`` for root forms. You +won't need to change this option and probably won't need to worry about +it. diff --git a/reference/forms/types/options/block_name.rst.inc b/reference/forms/types/options/block_name.rst.inc index 6cfdeaf9a10..b31f7ea6a25 100644 --- a/reference/forms/types/options/block_name.rst.inc +++ b/reference/forms/types/options/block_name.rst.inc @@ -1,5 +1,5 @@ block_name -~~~~~~~~~~~ +~~~~~~~~~~ **type**: ``string`` **default**: the form's name (see :ref:`Knowing which block to customize `) diff --git a/reference/forms/types/options/button_label.rst.inc b/reference/forms/types/options/button_label.rst.inc index 9cafe2fc8e4..9ef7cc60fab 100644 --- a/reference/forms/types/options/button_label.rst.inc +++ b/reference/forms/types/options/button_label.rst.inc @@ -3,8 +3,8 @@ label **type**: ``string`` **default**: The label is "guessed" from the field name -Sets the label that will be displayed on the button. The label can also be -directly set inside the template: +Sets the label that will be displayed on the button. The label can also +be directly set inside the template: .. configuration-block:: diff --git a/reference/forms/types/options/by_reference.rst.inc b/reference/forms/types/options/by_reference.rst.inc index 833552fc5ae..a2e80e1d544 100644 --- a/reference/forms/types/options/by_reference.rst.inc +++ b/reference/forms/types/options/by_reference.rst.inc @@ -40,6 +40,7 @@ So, all that ``by_reference=false`` really does is force the framework to call the setter on the parent object. Similarly, if you're using the :doc:`collection` -form type where your underlying collection data is an object (like with Doctrine's -``ArrayCollection``), then ``by_reference`` must be set to ``false`` if you -need the adder and remover (e.g. ``addAuthor()`` and ``removeAuthor()``) to be called. +form type where your underlying collection data is an object (like with +Doctrine's ``ArrayCollection``), then ``by_reference`` must be set to ``false`` +if you need the adder and remover (e.g. ``addAuthor()`` and ``removeAuthor()``) +to be called. diff --git a/reference/forms/types/options/cascade_validation.rst.inc b/reference/forms/types/options/cascade_validation.rst.inc index e97c88a02ae..8cb78482461 100644 --- a/reference/forms/types/options/cascade_validation.rst.inc +++ b/reference/forms/types/options/cascade_validation.rst.inc @@ -11,9 +11,10 @@ the data from ``CategoryType`` to also be validated. .. tip:: Instead of using this option, it is recommended that you use the ``Valid`` - constraint in your model to force validation on a child object stored on - a property. This cascades only the validation but not the use of the - ``validation_group`` option on child forms. You can read more about this - in the section about :ref:`Embedding a Single Object `. + constraint in your model to force validation on a child object stored + on a property. This cascades only the validation but not the use of + the ``validation_group`` option on child forms. You can read more + about this in the section about + :ref:`Embedding a Single Object `. .. include:: /reference/forms/types/options/_error_bubbling_hint.rst.inc diff --git a/reference/forms/types/options/compound.rst.inc b/reference/forms/types/options/compound.rst.inc index 009a2c9725a..7736a77567c 100644 --- a/reference/forms/types/options/compound.rst.inc +++ b/reference/forms/types/options/compound.rst.inc @@ -3,6 +3,6 @@ compound **type**: ``boolean`` **default**: ``true`` -This option specifies if a form is compound. This is independent of whether the -form actually has children. A form can be compound but not have any children -at all (e.g. an empty collection form). +This option specifies if a form is compound. This is independent of whether +the form actually has children. A form can be compound but not have any +children at all (e.g. an empty collection form). diff --git a/reference/forms/types/options/data.rst.inc b/reference/forms/types/options/data.rst.inc index 13afdfc44ac..c9bf76424c5 100644 --- a/reference/forms/types/options/data.rst.inc +++ b/reference/forms/types/options/data.rst.inc @@ -5,8 +5,8 @@ data When you create a form, each field initially displays the value of the corresponding property of the form's domain object (if an object is bound -to the form). If you want to override the initial value for the form or just -an individual field, you can set it in the data option:: +to the form). If you want to override the initial value for the form or +just an individual field, you can set it in the data option:: $builder->add('token', 'hidden', array( 'data' => 'abcdef', @@ -14,6 +14,6 @@ an individual field, you can set it in the data option:: .. note:: - The default values for form fields are taken directly from the - underlying data structure (e.g. an entity or an array). - The ``data`` option overrides this default value. + The default values for form fields are taken directly from the underlying + data structure (e.g. an entity or an array). The ``data`` option overrides + this default value. diff --git a/reference/forms/types/options/data_class.rst.inc b/reference/forms/types/options/data_class.rst.inc index 85024141f81..991e68635ea 100644 --- a/reference/forms/types/options/data_class.rst.inc +++ b/reference/forms/types/options/data_class.rst.inc @@ -3,8 +3,8 @@ data_class **type**: ``string`` -This option is used to set the appropriate data mapper to be used by the form, -so you can use it for any form field type which requires an object. +This option is used to set the appropriate data mapper to be used by the +form, so you can use it for any form field type which requires an object. .. code-block:: php diff --git a/reference/forms/types/options/date_format.rst.inc b/reference/forms/types/options/date_format.rst.inc index b6db52d68dd..62152ac48ac 100644 --- a/reference/forms/types/options/date_format.rst.inc +++ b/reference/forms/types/options/date_format.rst.inc @@ -4,12 +4,12 @@ format **type**: ``integer`` or ``string`` **default**: `IntlDateFormatter::MEDIUM`_ (or ``yyyy-MM-dd`` if `widget`_ is ``single_text``) -Option passed to the ``IntlDateFormatter`` class, used to transform user input -into the proper format. This is critical when the `widget`_ option is -set to ``single_text``, and will define how the user will input the data. +Option passed to the ``IntlDateFormatter`` class, used to transform user +input into the proper format. This is critical when the `widget`_ option +is set to ``single_text`` and will define how the user will input the data. By default, the format is determined based on the current user locale: meaning -that *the expected format will be different for different users*. You -can override it by passing the format as a string. +that *the expected format will be different for different users*. You can +override it by passing the format as a string. For more information on valid formats, see `Date/Time Format Syntax`_:: @@ -21,9 +21,10 @@ For more information on valid formats, see `Date/Time Format Syntax`_:: .. note:: - If you want your field to be rendered as an HTML5 "date" field, you have to - use a ``single_text`` widget with the ``yyyy-MM-dd`` format (the `RFC 3339`_ - format) which is the default value if you use the ``single_text`` widget. + If you want your field to be rendered as an HTML5 "date" field, you + have to use a ``single_text`` widget with the ``yyyy-MM-dd`` format + (the `RFC 3339`_ format) which is the default value if you use the + ``single_text`` widget. .. _`Date/Time Format Syntax`: http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax .. _`IntlDateFormatter::MEDIUM`: http://www.php.net/manual/en/class.intldateformatter.php#intl.intldateformatter-constants diff --git a/reference/forms/types/options/date_input.rst.inc b/reference/forms/types/options/date_input.rst.inc index 43f50abbd9d..e1078d88b6b 100644 --- a/reference/forms/types/options/date_input.rst.inc +++ b/reference/forms/types/options/date_input.rst.inc @@ -3,8 +3,8 @@ input **type**: ``string`` **default**: ``datetime`` -The format of the *input* data - i.e. the format that the date is stored on -your underlying object. Valid values are: +The format of the *input* data - i.e. the format that the date is stored +on your underlying object. Valid values are: * ``string`` (e.g. ``2011-06-05``) * ``datetime`` (a ``DateTime`` object) diff --git a/reference/forms/types/options/date_widget_description.rst.inc b/reference/forms/types/options/date_widget_description.rst.inc index 865af8472ac..b86bdde5a0e 100644 --- a/reference/forms/types/options/date_widget_description.rst.inc +++ b/reference/forms/types/options/date_widget_description.rst.inc @@ -1,11 +1,12 @@ **type**: ``string`` **default**: ``choice`` -The basic way in which this field should be rendered. Can be one of the following: +The basic way in which this field should be rendered. Can be one of the +following: * ``choice``: renders three select inputs. The order of the selects is defined in the `format`_ option. * ``text``: renders a three field input of type ``text`` (month, day, year). -* ``single_text``: renders a single input of type ``date``. User's input is - validated based on the `format`_ option. +* ``single_text``: renders a single input of type ``date``. User's input + is validated based on the `format`_ option. diff --git a/reference/forms/types/options/disabled.rst.inc b/reference/forms/types/options/disabled.rst.inc index 4a7190f4f10..3585aa2438d 100644 --- a/reference/forms/types/options/disabled.rst.inc +++ b/reference/forms/types/options/disabled.rst.inc @@ -6,5 +6,5 @@ disabled **type**: ``boolean`` **default**: ``false`` -If you don't want a user to modify the value of a field, you can set the disabled -option to true. Any submitted value will be ignored. +If you don't want a user to modify the value of a field, you can set the +disabled option to true. Any submitted value will be ignored. diff --git a/reference/forms/types/options/empty_data.rst.inc b/reference/forms/types/options/empty_data.rst.inc index 34ca9cb878c..f856d8d73fe 100644 --- a/reference/forms/types/options/empty_data.rst.inc +++ b/reference/forms/types/options/empty_data.rst.inc @@ -3,8 +3,9 @@ empty_data **type**: ``mixed`` -.. This file should only be included with start-after or end-before that's set to - this placeholder value. Its purpose is to let us include only part of this file. +.. This file should only be included with start-after or end-before that's + set to this placeholder value. Its purpose is to let us include only + part of this file. DEFAULT_PLACEHOLDER @@ -13,9 +14,7 @@ value is empty. But you can customize this to your needs. For example, if you want the ``gender`` choice field to be explicitly set to ``null`` when no value is -selected, you can do it like this: - -.. code-block:: php +selected, you can do it like this:: $builder->add('gender', 'choice', array( 'choices' => array( diff --git a/reference/forms/types/options/empty_value.rst.inc b/reference/forms/types/options/empty_value.rst.inc index f75b95b2b07..182540a5765 100644 --- a/reference/forms/types/options/empty_value.rst.inc +++ b/reference/forms/types/options/empty_value.rst.inc @@ -7,9 +7,9 @@ empty_value **type**: ``string`` or ``boolean`` -This option determines whether or not a special "empty" option (e.g. "Choose an option") -will appear at the top of a select widget. This option only applies if the -``multiple`` option is set to false. +This option determines whether or not a special "empty" option (e.g. "Choose +an option") will appear at the top of a select widget. This option only +applies if the ``multiple`` option is set to false. * Add an empty value with "Choose an option" as the text:: diff --git a/reference/forms/types/options/error_mapping.rst.inc b/reference/forms/types/options/error_mapping.rst.inc index cdca7e12d7c..dafd5e04248 100644 --- a/reference/forms/types/options/error_mapping.rst.inc +++ b/reference/forms/types/options/error_mapping.rst.inc @@ -28,8 +28,8 @@ field so that it displays above it:: Here are the rules for the left and the right side of the mapping: * The left side contains property paths; -* If the violation is generated on a property or method of a class, its path - is simply ``propertyName``; +* If the violation is generated on a property or method of a class, its + path is simply ``propertyName``; * If the violation is generated on an entry of an ``array`` or ``ArrayAccess`` object, the property path is ``[indexName]``; * You can construct nested property paths by concatenating them, separating diff --git a/reference/forms/types/options/grouping.rst.inc b/reference/forms/types/options/grouping.rst.inc index 39aeddb6b2b..4362678e339 100644 --- a/reference/forms/types/options/grouping.rst.inc +++ b/reference/forms/types/options/grouping.rst.inc @@ -3,8 +3,8 @@ grouping **type**: ``integer`` **default**: ``false`` -This value is used internally as the ``NumberFormatter::GROUPING_USED`` value -when using PHP's ``NumberFormatter`` class. Its documentation is non-existent, -but it appears that if you set this to ``true``, numbers will be grouped with -a comma or period (depending on your locale): ``12345.123`` would display -as ``12,345.123``. +This value is used internally as the ``NumberFormatter::GROUPING_USED`` +value when using PHP's ``NumberFormatter`` class. Its documentation is +non-existent, but it appears that if you set this to ``true``, numbers will +be grouped with a comma or period (depending on your locale): ``12345.123`` +would display as ``12,345.123``. diff --git a/reference/forms/types/options/inherit_data.rst.inc b/reference/forms/types/options/inherit_data.rst.inc index 3025e018660..c65ff78c7e3 100644 --- a/reference/forms/types/options/inherit_data.rst.inc +++ b/reference/forms/types/options/inherit_data.rst.inc @@ -13,6 +13,7 @@ multiple forms. See :doc:`/cookbook/form/inherit_data_option`. .. caution:: - When a field has the ``inherit_data`` option set, it uses the data of the - parent form as is. This means that :doc:`Data Transformers ` - won't be applied to that field. + When a field has the ``inherit_data`` option set, it uses the data of + the parent form as is. This means that + :doc:`Data Transformers ` won't be + applied to that field. diff --git a/reference/forms/types/options/invalid_message.rst.inc b/reference/forms/types/options/invalid_message.rst.inc index c5c05432492..d96705bf7d2 100644 --- a/reference/forms/types/options/invalid_message.rst.inc +++ b/reference/forms/types/options/invalid_message.rst.inc @@ -11,6 +11,6 @@ a :doc:`time` field that cannot be converted into a real time or if the user enters a string (e.g. ``apple``) into a number field. -Normal (business logic) validation (such as when setting a minimum length for -a field) should be set using validation messages with your validation rules -(:ref:`reference`). +Normal (business logic) validation (such as when setting a minimum length +for a field) should be set using validation messages with your validation +rules (:ref:`reference`). diff --git a/reference/forms/types/options/invalid_message_parameters.rst.inc b/reference/forms/types/options/invalid_message_parameters.rst.inc index 286fbc45cb6..72a327351a4 100644 --- a/reference/forms/types/options/invalid_message_parameters.rst.inc +++ b/reference/forms/types/options/invalid_message_parameters.rst.inc @@ -9,6 +9,6 @@ to that option and including the variables in this option:: $builder->add('some_field', 'some_type', array( // ... - 'invalid_message' => 'You entered an invalid value - it should include %num% letters', + 'invalid_message' => 'You entered an invalid value, it should include %num% letters', 'invalid_message_parameters' => array('%num%' => 6), )); diff --git a/reference/forms/types/options/label_attr.rst.inc b/reference/forms/types/options/label_attr.rst.inc index 5904b8e8d63..10d438c8c2a 100644 --- a/reference/forms/types/options/label_attr.rst.inc +++ b/reference/forms/types/options/label_attr.rst.inc @@ -3,15 +3,18 @@ label_attr **type**: ``array`` **default**: ``array()`` -Sets the HTML attributes for the ``