From 8d360d9a4def55a99c076dd3e4b342f18d5734b8 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 25 May 2015 10:59:45 +0200 Subject: [PATCH 01/20] Documented the Overridden Options of the Text type --- reference/forms/types/text.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/reference/forms/types/text.rst b/reference/forms/types/text.rst index 68e2c18875b..bd2c89ab900 100644 --- a/reference/forms/types/text.rst +++ b/reference/forms/types/text.rst @@ -9,6 +9,9 @@ The text field represents the most basic input text field. +-------------+--------------------------------------------------------------------+ | Rendered as | ``input`` ``text`` field | +-------------+--------------------------------------------------------------------+ +| Overridden | - `compound`_ | +| Options | | ++-------------+--------------------------------------------------------------------+ | Inherited | - `data`_ | | options | - `disabled`_ | | | - `empty_data`_ | @@ -27,6 +30,17 @@ The text field represents the most basic input text field. | Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\TextType` | +-------------+--------------------------------------------------------------------+ +Overridden Options +------------------ + +compound +~~~~~~~~ + +**type**: ``boolean`` **default**: ``false`` + +This option specifies if the type is compound. This is independent of whether +the type actually has children. A type can be compound but not have any +children at all. Inherited Options ----------------- From e66ec5cd08c79329d95de898422afbd97f115c38 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 25 May 2015 11:57:16 +0200 Subject: [PATCH 02/20] Created a compound_type file because this option is shared with lots of types --- reference/forms/types/options/compound_type.rst.inc | 8 ++++++++ reference/forms/types/text.rst | 9 +-------- 2 files changed, 9 insertions(+), 8 deletions(-) create mode 100644 reference/forms/types/options/compound_type.rst.inc diff --git a/reference/forms/types/options/compound_type.rst.inc b/reference/forms/types/options/compound_type.rst.inc new file mode 100644 index 00000000000..2b7d4e2b986 --- /dev/null +++ b/reference/forms/types/options/compound_type.rst.inc @@ -0,0 +1,8 @@ +compound +~~~~~~~~ + +**type**: ``boolean`` **default**: ``false`` + +This option specifies if the type is compound. This is independent of whether +the type actually has children. A type can be compound but not have any +children at all. diff --git a/reference/forms/types/text.rst b/reference/forms/types/text.rst index bd2c89ab900..e265a5e6527 100644 --- a/reference/forms/types/text.rst +++ b/reference/forms/types/text.rst @@ -33,14 +33,7 @@ The text field represents the most basic input text field. Overridden Options ------------------ -compound -~~~~~~~~ - -**type**: ``boolean`` **default**: ``false`` - -This option specifies if the type is compound. This is independent of whether -the type actually has children. A type can be compound but not have any -children at all. +.. include:: /reference/forms/types/options/compound_type.rst.inc Inherited Options ----------------- From a8ad338f7ef58406ef11454a16990d272b4e592c Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 25 May 2015 11:59:35 +0200 Subject: [PATCH 03/20] Documented overriden options for numeric types --- reference/forms/types/integer.rst | 8 ++++++++ reference/forms/types/money.rst | 8 ++++++++ reference/forms/types/number.rst | 8 ++++++++ reference/forms/types/percent.rst | 8 ++++++++ 4 files changed, 32 insertions(+) diff --git a/reference/forms/types/integer.rst b/reference/forms/types/integer.rst index e6ea1895cb5..2b07a16ed2d 100644 --- a/reference/forms/types/integer.rst +++ b/reference/forms/types/integer.rst @@ -16,6 +16,9 @@ integers. By default, all non-integer values (e.g. 6.78) will round down +-------------+-----------------------------------------------------------------------+ | Rendered as | ``input`` ``number`` field | +-------------+-----------------------------------------------------------------------+ +| Overridden | - `compound`_ | +| Options | | ++-------------+-----------------------------------------------------------------------+ | Options | - `grouping`_ | | | - `precision`_ | | | - `rounding_mode`_ | @@ -38,6 +41,11 @@ integers. By default, all non-integer values (e.g. 6.78) will round down | Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\IntegerType` | +-------------+-----------------------------------------------------------------------+ +Overridden Options +------------------ + +.. include:: /reference/forms/types/options/compound_type.rst.inc + Field Options ------------- diff --git a/reference/forms/types/money.rst b/reference/forms/types/money.rst index 29d0abedd86..03e00e6a43c 100644 --- a/reference/forms/types/money.rst +++ b/reference/forms/types/money.rst @@ -14,6 +14,9 @@ how the input and output of the data is handled. +-------------+---------------------------------------------------------------------+ | Rendered as | ``input`` ``text`` field | +-------------+---------------------------------------------------------------------+ +| Overridden | - `compound`_ | +| Options | | ++-------------+---------------------------------------------------------------------+ | Options | - `currency`_ | | | - `divisor`_ | | | - `grouping`_ | @@ -37,6 +40,11 @@ how the input and output of the data is handled. | Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\MoneyType` | +-------------+---------------------------------------------------------------------+ +Overridden Options +------------------ + +.. include:: /reference/forms/types/options/compound_type.rst.inc + Field Options ------------- diff --git a/reference/forms/types/number.rst b/reference/forms/types/number.rst index ec85bc52ad4..04c79e39b7e 100644 --- a/reference/forms/types/number.rst +++ b/reference/forms/types/number.rst @@ -11,6 +11,9 @@ that you want to use for your number. +-------------+----------------------------------------------------------------------+ | Rendered as | ``input`` ``text`` field | +-------------+----------------------------------------------------------------------+ +| Overridden | - `compound`_ | +| Options | | ++-------------+----------------------------------------------------------------------+ | Options | - `grouping`_ | | | - `precision`_ | | | - `rounding_mode`_ | @@ -33,6 +36,11 @@ that you want to use for your number. | Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\NumberType` | +-------------+----------------------------------------------------------------------+ +Overridden Options +------------------ + +.. include:: /reference/forms/types/options/compound_type.rst.inc + Field Options ------------- diff --git a/reference/forms/types/percent.rst b/reference/forms/types/percent.rst index 4aea0b90481..58992d84a14 100644 --- a/reference/forms/types/percent.rst +++ b/reference/forms/types/percent.rst @@ -15,6 +15,9 @@ This field adds a percentage sign "``%``" after the input box. +-------------+-----------------------------------------------------------------------+ | Rendered as | ``input`` ``text`` field | +-------------+-----------------------------------------------------------------------+ +| Overridden | - `compound`_ | +| Options | | ++-------------+-----------------------------------------------------------------------+ | Options | - `precision`_ | | | - `type`_ | +-------------+-----------------------------------------------------------------------+ @@ -36,6 +39,11 @@ This field adds a percentage sign "``%``" after the input box. | Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\PercentType` | +-------------+-----------------------------------------------------------------------+ +Overridden Options +------------------ + +.. include:: /reference/forms/types/options/compound_type.rst.inc + Field Options ------------- From 7ce81913d7486859690957f99a4d936c25d3e773 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 25 May 2015 12:01:14 +0200 Subject: [PATCH 04/20] Documented overridden options for hidden field --- reference/forms/types/hidden.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/reference/forms/types/hidden.rst b/reference/forms/types/hidden.rst index 6e1b8500fab..272eb853852 100644 --- a/reference/forms/types/hidden.rst +++ b/reference/forms/types/hidden.rst @@ -9,8 +9,9 @@ The hidden type represents a hidden input field. +-------------+----------------------------------------------------------------------+ | Rendered as | ``input`` ``hidden`` field | +-------------+----------------------------------------------------------------------+ -| Overriden | - `error_bubbling`_ | -| options | - `required`_ | +| Overriden | - `compound`_ | +| options | - `error_bubbling`_ | +| | - `required`_ | +-------------+----------------------------------------------------------------------+ | Inherited | - `data`_ | | options | - `error_mapping`_ | @@ -25,6 +26,8 @@ The hidden type represents a hidden input field. Overridden Options ------------------ +.. include:: /reference/forms/types/options/compound_type.rst.inc + error_bubbling ~~~~~~~~~~~~~~ From 618e11dc6764e7df447f54aaa5f3dfd49e0943d6 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 25 May 2015 12:12:06 +0200 Subject: [PATCH 05/20] Documented the overridden options for "time" type --- reference/forms/types/time.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/reference/forms/types/time.rst b/reference/forms/types/time.rst index b8765688db5..53037687656 100644 --- a/reference/forms/types/time.rst +++ b/reference/forms/types/time.rst @@ -27,6 +27,8 @@ stored as a ``DateTime`` object, a string, a timestamp or an array. | | - `with_seconds`_ | +----------------------+-----------------------------------------------------------------------------+ | Overridden Options | - `by_reference`_ | +| | - `compound`_ | +| | - `data_class`_ | | | - `error_bubbling`_ | +----------------------+-----------------------------------------------------------------------------+ | Inherited | - `data`_ | @@ -139,6 +141,17 @@ by_reference The ``DateTime`` classes are treated as immutable objects. +.. include:: /reference/forms/types/options/compound_type.rst.inc + +data_class +~~~~~~~~~~ + +**default**: ``null`` + +The internal normalized representation of this type is an array, not a ``\DateTime`` +object. Therefore, the ``data_class`` option is initialized to ``null`` to avoid +the ``FormType`` object from initializing it to ``\DateTime``. + error_bubbling ~~~~~~~~~~~~~~ From 8e825d989cccc5f26d45a8b50399ce08eead271d Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 25 May 2015 12:25:31 +0200 Subject: [PATCH 06/20] Documented the overridden options of the "password" type --- reference/forms/types/password.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/reference/forms/types/password.rst b/reference/forms/types/password.rst index 8382a0fc0e9..e050717680e 100644 --- a/reference/forms/types/password.rst +++ b/reference/forms/types/password.rst @@ -9,6 +9,9 @@ The ``password`` field renders an input password text box. +-------------+------------------------------------------------------------------------+ | Rendered as | ``input`` ``password`` field | +-------------+------------------------------------------------------------------------+ +| Overridden | - `trim`_ | +| Options | | ++-------------+------------------------------------------------------------------------+ | Options | - `always_empty`_ | +-------------+------------------------------------------------------------------------+ | Inherited | - `disabled`_ | @@ -28,6 +31,19 @@ The ``password`` field renders an input password text box. | Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\PasswordType` | +-------------+------------------------------------------------------------------------+ +Overridden Options +------------------ + +trim +~~~~ + +**default**: ``false`` + +Unlike the rest of form types, the ``password`` type doesn't apply the +phpfunction:`trim` function to the value submitted by the user. This ensures that +the password is merged back onto the underlying object exactly as it was typed +by the user. + Field Options ------------- From e41b3cc324387a6d7649cf12b53f1c7a1d65d197 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 25 May 2015 12:40:35 +0200 Subject: [PATCH 07/20] Documented overridden options for "file" type --- reference/forms/types/file.rst | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/reference/forms/types/file.rst b/reference/forms/types/file.rst index b60666c3893..008f6ebf1fb 100644 --- a/reference/forms/types/file.rst +++ b/reference/forms/types/file.rst @@ -9,6 +9,10 @@ The ``file`` type represents a file input in your form. +-------------+---------------------------------------------------------------------+ | Rendered as | ``input`` ``file`` field | +-------------+---------------------------------------------------------------------+ +| Overridden | - `compound`_ | +| Options | - `data_class`_ | +| | - `empty_data`_ | ++-------------+---------------------------------------------------------------------+ | Inherited | - `disabled`_ | | options | - `empty_data`_ | | | - `error_bubbling`_ | @@ -24,6 +28,26 @@ The ``file`` type represents a file input in your form. | Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\FileType` | +-------------+---------------------------------------------------------------------+ +Overridden Options +------------------ + +.. include:: /reference/forms/types/options/compound_type.rst.inc + +data_class +~~~~~~~~~~ + +**default**: :class:`Symfony\\Component\\HttpFoundation\\File\\File` + +This option sets the appropriate file-realted data mapper to be used by the type. + +empty_data +~~~~~~~~~~ + +**default**: ``null`` + +This option is set to ``null`` automatically because it is not used by the +renderd field widget. + Basic Usage ----------- From f44e971770c8aa0949b088bd53dc6ff14659828b Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 25 May 2015 12:43:30 +0200 Subject: [PATCH 08/20] Documented the overridden options of "date" type --- reference/forms/types/date.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/reference/forms/types/date.rst b/reference/forms/types/date.rst index 33794d61d78..becfa3ca5bb 100644 --- a/reference/forms/types/date.rst +++ b/reference/forms/types/date.rst @@ -30,6 +30,8 @@ day and year) or three select boxes (see the `widget`_ option). | | - `years`_ | +----------------------+-----------------------------------------------------------------------------+ | Overridden Options | - `by_reference`_ | +| | - `compound`_ | +| | - `data_class`_ | | | - `error_bubbling`_ | +----------------------+-----------------------------------------------------------------------------+ | Inherited | - `data`_ | @@ -125,6 +127,17 @@ by_reference The ``DateTime`` classes are treated as immutable objects. +.. include:: /reference/forms/types/options/compound_type.rst.inc + +data_class +~~~~~~~~~~ + +**default**: ``null`` + +The internal normalized representation of this type is an array, not a ``\DateTime`` +object. Therefore, the ``data_class`` option is initialized to ``null`` to avoid +the ``FormType`` object from initializing it to ``\DateTime``. + error_bubbling ~~~~~~~~~~~~~~ From 48b402b22e3a1f949466ca1728e2cad846f1acb7 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 25 May 2015 12:46:27 +0200 Subject: [PATCH 09/20] Extracted the common "data_class" option explanation for data-related types --- reference/forms/types/date.rst | 9 +------ reference/forms/types/datetime.rst | 24 +++++++++++++++++++ .../types/options/data_class_date.rst.inc | 8 +++++++ reference/forms/types/time.rst | 9 +------ 4 files changed, 34 insertions(+), 16 deletions(-) create mode 100644 reference/forms/types/options/data_class_date.rst.inc diff --git a/reference/forms/types/date.rst b/reference/forms/types/date.rst index becfa3ca5bb..8fa7fc662e6 100644 --- a/reference/forms/types/date.rst +++ b/reference/forms/types/date.rst @@ -129,14 +129,7 @@ The ``DateTime`` classes are treated as immutable objects. .. include:: /reference/forms/types/options/compound_type.rst.inc -data_class -~~~~~~~~~~ - -**default**: ``null`` - -The internal normalized representation of this type is an array, not a ``\DateTime`` -object. Therefore, the ``data_class`` option is initialized to ``null`` to avoid -the ``FormType`` object from initializing it to ``\DateTime``. +.. include:: /reference/forms/types/options/data_class_date.rst.inc error_bubbling ~~~~~~~~~~~~~~ diff --git a/reference/forms/types/datetime.rst b/reference/forms/types/datetime.rst index 01ac12fb25c..a893822faaf 100644 --- a/reference/forms/types/datetime.rst +++ b/reference/forms/types/datetime.rst @@ -15,6 +15,11 @@ the data can be a ``DateTime`` object, a string, a timestamp or an array. +----------------------+-----------------------------------------------------------------------------+ | Rendered as | single text box or three select fields | +----------------------+-----------------------------------------------------------------------------+ +| Overridden Options | - `by_reference`_ | +| | - `compound`_ | +| | - `data_class`_ | +| | - `error_bubbling`_ | ++----------------------+-----------------------------------------------------------------------------+ | Options | - `date_format`_ | | | - `date_widget`_ | | | - `days`_ | @@ -46,6 +51,25 @@ the data can be a ``DateTime`` object, a string, a timestamp or an array. | Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\DateTimeType` | +----------------------+-----------------------------------------------------------------------------+ +Overridden Options +------------------ + +by_reference +~~~~~~~~~~~~ + +**default**: ``false`` + +The ``DateTime`` classes are treated as immutable objects. + +.. include:: /reference/forms/types/options/compound_type.rst.inc + +.. include:: /reference/forms/types/options/data_class_date.rst.inc + +error_bubbling +~~~~~~~~~~~~~~ + +**default**: ``false`` + Field Options ------------- diff --git a/reference/forms/types/options/data_class_date.rst.inc b/reference/forms/types/options/data_class_date.rst.inc new file mode 100644 index 00000000000..f0d5dfc5427 --- /dev/null +++ b/reference/forms/types/options/data_class_date.rst.inc @@ -0,0 +1,8 @@ +data_class +~~~~~~~~~~ + +**default**: ``null`` + +The internal normalized representation of this type is an array, not a ``\DateTime`` +object. Therefore, the ``data_class`` option is initialized to ``null`` to avoid +the ``FormType`` object from initializing it to ``\DateTime``. diff --git a/reference/forms/types/time.rst b/reference/forms/types/time.rst index 53037687656..477983f9028 100644 --- a/reference/forms/types/time.rst +++ b/reference/forms/types/time.rst @@ -143,14 +143,7 @@ The ``DateTime`` classes are treated as immutable objects. .. include:: /reference/forms/types/options/compound_type.rst.inc -data_class -~~~~~~~~~~ - -**default**: ``null`` - -The internal normalized representation of this type is an array, not a ``\DateTime`` -object. Therefore, the ``data_class`` option is initialized to ``null`` to avoid -the ``FormType`` object from initializing it to ``\DateTime``. +.. include:: /reference/forms/types/options/data_class_date.rst.inc error_bubbling ~~~~~~~~~~~~~~ From 7f8e09a1ad6c9d9d8fe453b985247c759bcc535b Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 25 May 2015 12:55:42 +0200 Subject: [PATCH 10/20] Removed a duplicated option explanation in "file" type --- reference/forms/types/file.rst | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/reference/forms/types/file.rst b/reference/forms/types/file.rst index 008f6ebf1fb..cae2796068e 100644 --- a/reference/forms/types/file.rst +++ b/reference/forms/types/file.rst @@ -14,8 +14,7 @@ The ``file`` type represents a file input in your form. | | - `empty_data`_ | +-------------+---------------------------------------------------------------------+ | Inherited | - `disabled`_ | -| options | - `empty_data`_ | -| | - `error_bubbling`_ | +| options | - `error_bubbling`_ | | | - `error_mapping`_ | | | - `label`_ | | | - `label_attr`_ | @@ -45,8 +44,8 @@ empty_data **default**: ``null`` -This option is set to ``null`` automatically because it is not used by the -renderd field widget. +This option determines what value the field will return when the submitted +value is empty. Basic Usage ----------- @@ -111,9 +110,6 @@ type: The default value is ``null``. -.. include:: /reference/forms/types/options/empty_data.rst.inc - :start-after: DEFAULT_PLACEHOLDER - .. include:: /reference/forms/types/options/error_bubbling.rst.inc .. include:: /reference/forms/types/options/error_mapping.rst.inc From 1dc53fa93645a3b66eeeb63fd965af262d44989e Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 25 May 2015 13:00:05 +0200 Subject: [PATCH 11/20] Removed again a duplicated option explanation --- reference/forms/types/file.rst | 3 --- 1 file changed, 3 deletions(-) diff --git a/reference/forms/types/file.rst b/reference/forms/types/file.rst index cae2796068e..78f7c70eb0c 100644 --- a/reference/forms/types/file.rst +++ b/reference/forms/types/file.rst @@ -105,9 +105,6 @@ type: .. include:: /reference/forms/types/options/disabled.rst.inc -.. include:: /reference/forms/types/options/empty_data.rst.inc - :end-before: DEFAULT_PLACEHOLDER - The default value is ``null``. .. include:: /reference/forms/types/options/error_bubbling.rst.inc From 32c0af1c214b9b4012d85a85b222e484ca882a4c Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 25 May 2015 13:09:09 +0200 Subject: [PATCH 12/20] Removed a duplicated "trim" option in the "password" type --- reference/forms/types/password.rst | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/reference/forms/types/password.rst b/reference/forms/types/password.rst index e050717680e..0f3651769c1 100644 --- a/reference/forms/types/password.rst +++ b/reference/forms/types/password.rst @@ -24,7 +24,6 @@ The ``password`` field renders an input password text box. | | - `max_length`_ | | | - `read_only`_ | | | - `required`_ | -| | - `trim`_ | +-------------+------------------------------------------------------------------------+ | Parent type | :doc:`text ` | +-------------+------------------------------------------------------------------------+ @@ -92,13 +91,3 @@ The default value is ``''`` (the empty string). .. include:: /reference/forms/types/options/read_only.rst.inc .. include:: /reference/forms/types/options/required.rst.inc - -trim -~~~~ - -**type**: ``boolean`` **default**: ``false`` - -If true, the whitespace of the submitted string value will be stripped -via the :phpfunction:`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. From 974dfefe1ff7c7cc20a518b18cddab1b7eb8de56 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 25 May 2015 14:58:44 +0200 Subject: [PATCH 13/20] Fixed errors noticed by Wouter --- reference/forms/types/file.rst | 2 -- reference/forms/types/password.rst | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/reference/forms/types/file.rst b/reference/forms/types/file.rst index 78f7c70eb0c..278b1e586bf 100644 --- a/reference/forms/types/file.rst +++ b/reference/forms/types/file.rst @@ -105,8 +105,6 @@ type: .. include:: /reference/forms/types/options/disabled.rst.inc -The default value is ``null``. - .. include:: /reference/forms/types/options/error_bubbling.rst.inc .. include:: /reference/forms/types/options/error_mapping.rst.inc diff --git a/reference/forms/types/password.rst b/reference/forms/types/password.rst index 0f3651769c1..a7010fe10b8 100644 --- a/reference/forms/types/password.rst +++ b/reference/forms/types/password.rst @@ -39,7 +39,7 @@ trim **default**: ``false`` Unlike the rest of form types, the ``password`` type doesn't apply the -phpfunction:`trim` function to the value submitted by the user. This ensures that +:phpfunction:`trim` function to the value submitted by the user. This ensures that the password is merged back onto the underlying object exactly as it was typed by the user. From eb20dc8f3e84b72a244242313ed60d14e809e627 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 25 May 2015 15:38:03 +0200 Subject: [PATCH 14/20] Fixer minor issues --- reference/forms/types/country.rst | 2 +- reference/forms/types/currency.rst | 2 +- reference/forms/types/date.rst | 2 +- reference/forms/types/datetime.rst | 2 +- reference/forms/types/entity.rst | 4 ++-- reference/forms/types/file.rst | 2 +- reference/forms/types/integer.rst | 2 +- reference/forms/types/language.rst | 2 +- reference/forms/types/locale.rst | 2 +- reference/forms/types/money.rst | 2 +- reference/forms/types/number.rst | 2 +- reference/forms/types/options/data_class_date.rst.inc | 2 +- reference/forms/types/password.rst | 2 +- reference/forms/types/percent.rst | 2 +- reference/forms/types/repeated.rst | 2 +- reference/forms/types/text.rst | 2 +- reference/forms/types/time.rst | 2 +- reference/forms/types/timezone.rst | 2 +- 18 files changed, 19 insertions(+), 19 deletions(-) diff --git a/reference/forms/types/country.rst b/reference/forms/types/country.rst index 6efabd4dad1..9b44a076432 100644 --- a/reference/forms/types/country.rst +++ b/reference/forms/types/country.rst @@ -23,7 +23,7 @@ you should just use the ``choice`` type directly. | Rendered as | can be various tags (see :ref:`forms-reference-choice-tags`) | +-------------+-----------------------------------------------------------------------+ | Overridden | - `choices`_ | -| Options | | +| options | | +-------------+-----------------------------------------------------------------------+ | Inherited | from the :doc:`choice ` type | | options | | diff --git a/reference/forms/types/currency.rst b/reference/forms/types/currency.rst index 14a433fc188..0f86a3cee07 100644 --- a/reference/forms/types/currency.rst +++ b/reference/forms/types/currency.rst @@ -17,7 +17,7 @@ you should just use the ``choice`` type directly. | Rendered as | can be various tags (see :ref:`forms-reference-choice-tags`) | +-------------+------------------------------------------------------------------------+ | Overridden | - `choices`_ | -| Options | | +| options | | +-------------+------------------------------------------------------------------------+ | Inherited | from the :doc:`choice ` type | | options | | diff --git a/reference/forms/types/date.rst b/reference/forms/types/date.rst index 8fa7fc662e6..bd456e7f758 100644 --- a/reference/forms/types/date.rst +++ b/reference/forms/types/date.rst @@ -29,7 +29,7 @@ day and year) or three select boxes (see the `widget`_ option). | | - `widget`_ | | | - `years`_ | +----------------------+-----------------------------------------------------------------------------+ -| Overridden Options | - `by_reference`_ | +| Overridden options | - `by_reference`_ | | | - `compound`_ | | | - `data_class`_ | | | - `error_bubbling`_ | diff --git a/reference/forms/types/datetime.rst b/reference/forms/types/datetime.rst index a893822faaf..27a25e601df 100644 --- a/reference/forms/types/datetime.rst +++ b/reference/forms/types/datetime.rst @@ -15,7 +15,7 @@ the data can be a ``DateTime`` object, a string, a timestamp or an array. +----------------------+-----------------------------------------------------------------------------+ | Rendered as | single text box or three select fields | +----------------------+-----------------------------------------------------------------------------+ -| Overridden Options | - `by_reference`_ | +| Overridden options | - `by_reference`_ | | | - `compound`_ | | | - `data_class`_ | | | - `error_bubbling`_ | diff --git a/reference/forms/types/entity.rst b/reference/forms/types/entity.rst index f46229083fe..f096533830e 100644 --- a/reference/forms/types/entity.rst +++ b/reference/forms/types/entity.rst @@ -19,8 +19,8 @@ objects from the database. | | - `property`_ | | | - `query_builder`_ | +-------------+------------------------------------------------------------------+ -| Overriden | - `choice_list`_ | -| options | - `choices`_ | +| Overridden | - `choices`_ | +| options | - `choice_list`_ | +-------------+------------------------------------------------------------------+ | Inherited | from the :doc:`choice ` type: | | options | | diff --git a/reference/forms/types/file.rst b/reference/forms/types/file.rst index 278b1e586bf..3421f55fa91 100644 --- a/reference/forms/types/file.rst +++ b/reference/forms/types/file.rst @@ -10,7 +10,7 @@ The ``file`` type represents a file input in your form. | Rendered as | ``input`` ``file`` field | +-------------+---------------------------------------------------------------------+ | Overridden | - `compound`_ | -| Options | - `data_class`_ | +| options | - `data_class`_ | | | - `empty_data`_ | +-------------+---------------------------------------------------------------------+ | Inherited | - `disabled`_ | diff --git a/reference/forms/types/integer.rst b/reference/forms/types/integer.rst index 2b07a16ed2d..4a571df3652 100644 --- a/reference/forms/types/integer.rst +++ b/reference/forms/types/integer.rst @@ -17,7 +17,7 @@ integers. By default, all non-integer values (e.g. 6.78) will round down | Rendered as | ``input`` ``number`` field | +-------------+-----------------------------------------------------------------------+ | Overridden | - `compound`_ | -| Options | | +| options | | +-------------+-----------------------------------------------------------------------+ | Options | - `grouping`_ | | | - `precision`_ | diff --git a/reference/forms/types/language.rst b/reference/forms/types/language.rst index 75689b88771..dcc1879daad 100644 --- a/reference/forms/types/language.rst +++ b/reference/forms/types/language.rst @@ -24,7 +24,7 @@ you should just use the ``choice`` type directly. | Rendered as | can be various tags (see :ref:`forms-reference-choice-tags`) | +-------------+------------------------------------------------------------------------+ | Overridden | - `choices`_ | -| Options | | +| options | | +-------------+------------------------------------------------------------------------+ | Inherited | from the :doc:`choice ` type | | options | | diff --git a/reference/forms/types/locale.rst b/reference/forms/types/locale.rst index daa14e90e41..6126d577676 100644 --- a/reference/forms/types/locale.rst +++ b/reference/forms/types/locale.rst @@ -26,7 +26,7 @@ you should just use the ``choice`` type directly. | Rendered as | can be various tags (see :ref:`forms-reference-choice-tags`) | +-------------+------------------------------------------------------------------------+ | Overridden | - `choices`_ | -| Options | | +| options | | +-------------+------------------------------------------------------------------------+ | Inherited | from the :doc:`choice ` type | | options | | diff --git a/reference/forms/types/money.rst b/reference/forms/types/money.rst index 03e00e6a43c..a1a7247bf15 100644 --- a/reference/forms/types/money.rst +++ b/reference/forms/types/money.rst @@ -15,7 +15,7 @@ how the input and output of the data is handled. | Rendered as | ``input`` ``text`` field | +-------------+---------------------------------------------------------------------+ | Overridden | - `compound`_ | -| Options | | +| options | | +-------------+---------------------------------------------------------------------+ | Options | - `currency`_ | | | - `divisor`_ | diff --git a/reference/forms/types/number.rst b/reference/forms/types/number.rst index 04c79e39b7e..3dae2121195 100644 --- a/reference/forms/types/number.rst +++ b/reference/forms/types/number.rst @@ -12,7 +12,7 @@ that you want to use for your number. | Rendered as | ``input`` ``text`` field | +-------------+----------------------------------------------------------------------+ | Overridden | - `compound`_ | -| Options | | +| options | | +-------------+----------------------------------------------------------------------+ | Options | - `grouping`_ | | | - `precision`_ | diff --git a/reference/forms/types/options/data_class_date.rst.inc b/reference/forms/types/options/data_class_date.rst.inc index f0d5dfc5427..d11296e263f 100644 --- a/reference/forms/types/options/data_class_date.rst.inc +++ b/reference/forms/types/options/data_class_date.rst.inc @@ -1,7 +1,7 @@ data_class ~~~~~~~~~~ -**default**: ``null`` +**type**: ``string`` **default**: ``null`` The internal normalized representation of this type is an array, not a ``\DateTime`` object. Therefore, the ``data_class`` option is initialized to ``null`` to avoid diff --git a/reference/forms/types/password.rst b/reference/forms/types/password.rst index a7010fe10b8..1933a570851 100644 --- a/reference/forms/types/password.rst +++ b/reference/forms/types/password.rst @@ -10,7 +10,7 @@ The ``password`` field renders an input password text box. | Rendered as | ``input`` ``password`` field | +-------------+------------------------------------------------------------------------+ | Overridden | - `trim`_ | -| Options | | +| options | | +-------------+------------------------------------------------------------------------+ | Options | - `always_empty`_ | +-------------+------------------------------------------------------------------------+ diff --git a/reference/forms/types/percent.rst b/reference/forms/types/percent.rst index 58992d84a14..12aded78a3e 100644 --- a/reference/forms/types/percent.rst +++ b/reference/forms/types/percent.rst @@ -16,7 +16,7 @@ This field adds a percentage sign "``%``" after the input box. | Rendered as | ``input`` ``text`` field | +-------------+-----------------------------------------------------------------------+ | Overridden | - `compound`_ | -| Options | | +| options | | +-------------+-----------------------------------------------------------------------+ | Options | - `precision`_ | | | - `type`_ | diff --git a/reference/forms/types/repeated.rst b/reference/forms/types/repeated.rst index 8a69f565100..4556ecc88d8 100644 --- a/reference/forms/types/repeated.rst +++ b/reference/forms/types/repeated.rst @@ -20,7 +20,7 @@ accuracy. | | - `type`_ | +-------------+------------------------------------------------------------------------+ | Overridden | - `error_bubbling`_ | -| Options | | +| options | | +-------------+------------------------------------------------------------------------+ | Inherited | - `data`_ | | options | - `error_mapping`_ | diff --git a/reference/forms/types/text.rst b/reference/forms/types/text.rst index e265a5e6527..dcd598de69e 100644 --- a/reference/forms/types/text.rst +++ b/reference/forms/types/text.rst @@ -10,7 +10,7 @@ The text field represents the most basic input text field. | Rendered as | ``input`` ``text`` field | +-------------+--------------------------------------------------------------------+ | Overridden | - `compound`_ | -| Options | | +| options | | +-------------+--------------------------------------------------------------------+ | Inherited | - `data`_ | | options | - `disabled`_ | diff --git a/reference/forms/types/time.rst b/reference/forms/types/time.rst index 477983f9028..d531cc09f86 100644 --- a/reference/forms/types/time.rst +++ b/reference/forms/types/time.rst @@ -26,7 +26,7 @@ stored as a ``DateTime`` object, a string, a timestamp or an array. | | - `with_minutes`_ | | | - `with_seconds`_ | +----------------------+-----------------------------------------------------------------------------+ -| Overridden Options | - `by_reference`_ | +| Overridden options | - `by_reference`_ | | | - `compound`_ | | | - `data_class`_ | | | - `error_bubbling`_ | diff --git a/reference/forms/types/timezone.rst b/reference/forms/types/timezone.rst index b8c6fd65d2d..6764c1b62e5 100644 --- a/reference/forms/types/timezone.rst +++ b/reference/forms/types/timezone.rst @@ -19,7 +19,7 @@ you should just use the ``choice`` type directly. | Rendered as | can be various tags (see :ref:`forms-reference-choice-tags`) | +-------------+------------------------------------------------------------------------+ | Overridden | - `choices`_ | -| Options | | +| options | | +-------------+------------------------------------------------------------------------+ | Inherited | from the :doc:`choice ` type | | options | | From 0a5781b853de85e6359319bbd0d7973484f2e4d8 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 29 May 2015 08:44:22 +0200 Subject: [PATCH 15/20] Improved the explanation about the "compoun" option --- reference/forms/types/options/compound_type.rst.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/forms/types/options/compound_type.rst.inc b/reference/forms/types/options/compound_type.rst.inc index 2b7d4e2b986..39e4abc3dfc 100644 --- a/reference/forms/types/options/compound_type.rst.inc +++ b/reference/forms/types/options/compound_type.rst.inc @@ -3,6 +3,6 @@ compound **type**: ``boolean`` **default**: ``false`` -This option specifies if the type is compound. This is independent of whether -the type actually has children. A type can be compound but not have any -children at all. +This option specifies whether the type contains child types or not. This option +is managed internally for built-in types, so there is no need to configure +it explicitly. From e14b650db730a1d378bf3ac968d5cd5454943142 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 4 Jun 2015 09:02:20 +0200 Subject: [PATCH 16/20] Fixed the order of the different options --- reference/forms/types/datetime.rst | 48 +++++++++++++++--------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/reference/forms/types/datetime.rst b/reference/forms/types/datetime.rst index 27a25e601df..b95d9d6cea2 100644 --- a/reference/forms/types/datetime.rst +++ b/reference/forms/types/datetime.rst @@ -15,11 +15,6 @@ the data can be a ``DateTime`` object, a string, a timestamp or an array. +----------------------+-----------------------------------------------------------------------------+ | Rendered as | single text box or three select fields | +----------------------+-----------------------------------------------------------------------------+ -| Overridden options | - `by_reference`_ | -| | - `compound`_ | -| | - `data_class`_ | -| | - `error_bubbling`_ | -+----------------------+-----------------------------------------------------------------------------+ | Options | - `date_format`_ | | | - `date_widget`_ | | | - `days`_ | @@ -38,6 +33,11 @@ the data can be a ``DateTime`` object, a string, a timestamp or an array. | | - `with_seconds`_ | | | - `years`_ | +----------------------+-----------------------------------------------------------------------------+ +| Overridden options | - `by_reference`_ | +| | - `compound`_ | +| | - `data_class`_ | +| | - `error_bubbling`_ | ++----------------------+-----------------------------------------------------------------------------+ | Inherited | - `data`_ | | options | - `disabled`_ | | | - `inherit_data`_ | @@ -51,25 +51,6 @@ the data can be a ``DateTime`` object, a string, a timestamp or an array. | Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\DateTimeType` | +----------------------+-----------------------------------------------------------------------------+ -Overridden Options ------------------- - -by_reference -~~~~~~~~~~~~ - -**default**: ``false`` - -The ``DateTime`` classes are treated as immutable objects. - -.. include:: /reference/forms/types/options/compound_type.rst.inc - -.. include:: /reference/forms/types/options/data_class_date.rst.inc - -error_bubbling -~~~~~~~~~~~~~~ - -**default**: ``false`` - Field Options ------------- @@ -155,6 +136,25 @@ with the `date_widget`_ and `time_widget`_ options. .. include:: /reference/forms/types/options/years.rst.inc +Overridden Options +------------------ + +by_reference +~~~~~~~~~~~~ + +**default**: ``false`` + +The ``DateTime`` classes are treated as immutable objects. + +.. include:: /reference/forms/types/options/compound_type.rst.inc + +.. include:: /reference/forms/types/options/data_class_date.rst.inc + +error_bubbling +~~~~~~~~~~~~~~ + +**default**: ``false`` + Inherited Options ----------------- From 2b63f24222e775035710f202d36d2a13744281a3 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 4 Jun 2015 09:03:16 +0200 Subject: [PATCH 17/20] Fixed the order of the different options --- reference/forms/types/password.rst | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/reference/forms/types/password.rst b/reference/forms/types/password.rst index 1933a570851..75108368bb1 100644 --- a/reference/forms/types/password.rst +++ b/reference/forms/types/password.rst @@ -9,11 +9,11 @@ The ``password`` field renders an input password text box. +-------------+------------------------------------------------------------------------+ | Rendered as | ``input`` ``password`` field | +-------------+------------------------------------------------------------------------+ +| Options | - `always_empty`_ | ++-------------+------------------------------------------------------------------------+ | Overridden | - `trim`_ | | options | | +-------------+------------------------------------------------------------------------+ -| Options | - `always_empty`_ | -+-------------+------------------------------------------------------------------------+ | Inherited | - `disabled`_ | | options | - `empty_data`_ | | | - `error_bubbling`_ | @@ -30,19 +30,6 @@ The ``password`` field renders an input password text box. | Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\PasswordType` | +-------------+------------------------------------------------------------------------+ -Overridden Options ------------------- - -trim -~~~~ - -**default**: ``false`` - -Unlike the rest of form types, the ``password`` type doesn't apply the -:phpfunction:`trim` function to the value submitted by the user. This ensures that -the password is merged back onto the underlying object exactly as it was typed -by the user. - Field Options ------------- @@ -59,6 +46,18 @@ 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 and submit the form. +Overridden Options +------------------ + +trim +~~~~ + +**default**: ``false`` + +Unlike the rest of form types, the ``password`` type doesn't apply the +:phpfunction:`trim` function to the value submitted by the user. This ensures that +the password is merged back onto the underlying object exactly as it was typed +by the user. Inherited Options ----------------- From 62a11d55bbe7194f509e0af8fb4dd9887b3f370d Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 4 Jun 2015 09:07:55 +0200 Subject: [PATCH 18/20] Added missing types in overridden options --- reference/forms/types/file.rst | 4 ++-- reference/forms/types/password.rst | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/forms/types/file.rst b/reference/forms/types/file.rst index 3421f55fa91..d383456a608 100644 --- a/reference/forms/types/file.rst +++ b/reference/forms/types/file.rst @@ -35,14 +35,14 @@ Overridden Options data_class ~~~~~~~~~~ -**default**: :class:`Symfony\\Component\\HttpFoundation\\File\\File` +**type**: ``string`` **default**: :class:`Symfony\\Component\\HttpFoundation\\File\\File` This option sets the appropriate file-realted data mapper to be used by the type. empty_data ~~~~~~~~~~ -**default**: ``null`` +**type**: ``mixed`` **default**: ``null`` This option determines what value the field will return when the submitted value is empty. diff --git a/reference/forms/types/password.rst b/reference/forms/types/password.rst index 75108368bb1..70506f5abc0 100644 --- a/reference/forms/types/password.rst +++ b/reference/forms/types/password.rst @@ -52,7 +52,7 @@ Overridden Options trim ~~~~ -**default**: ``false`` +**type**: ``boolean`` **default**: ``false`` Unlike the rest of form types, the ``password`` type doesn't apply the :phpfunction:`trim` function to the value submitted by the user. This ensures that From 596a0bcdd162883eeb45bb714e3bf0860317bca3 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 5 Jun 2015 08:34:09 +0200 Subject: [PATCH 19/20] Reordered two overridden options --- reference/forms/types/entity.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/forms/types/entity.rst b/reference/forms/types/entity.rst index f096533830e..fd59bef9a29 100644 --- a/reference/forms/types/entity.rst +++ b/reference/forms/types/entity.rst @@ -19,8 +19,8 @@ objects from the database. | | - `property`_ | | | - `query_builder`_ | +-------------+------------------------------------------------------------------+ -| Overridden | - `choices`_ | -| options | - `choice_list`_ | +| Overridden | - `choice_list`_ | +| options | - `choices`_ | +-------------+------------------------------------------------------------------+ | Inherited | from the :doc:`choice ` type: | | options | | From 84633dbff004f9c607ccc3a528a4e334e22bb1da Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 5 Jun 2015 08:34:49 +0200 Subject: [PATCH 20/20] Fixed a typo --- reference/forms/types/file.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/forms/types/file.rst b/reference/forms/types/file.rst index d383456a608..188f0d0ec59 100644 --- a/reference/forms/types/file.rst +++ b/reference/forms/types/file.rst @@ -37,7 +37,7 @@ data_class **type**: ``string`` **default**: :class:`Symfony\\Component\\HttpFoundation\\File\\File` -This option sets the appropriate file-realted data mapper to be used by the type. +This option sets the appropriate file-related data mapper to be used by the type. empty_data ~~~~~~~~~~