From 07a168a8f6c0fb4d67574df90737f332bd246ff3 Mon Sep 17 00:00:00 2001 From: Johan Desmyter Date: Fri, 3 Jan 2014 08:48:01 +0300 Subject: [PATCH 1/7] add default value to mapped option of entity --- reference/forms/types/options/mapped.rst.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/forms/types/options/mapped.rst.inc b/reference/forms/types/options/mapped.rst.inc index 434f97ebd89..044eedc815e 100644 --- a/reference/forms/types/options/mapped.rst.inc +++ b/reference/forms/types/options/mapped.rst.inc @@ -1,7 +1,7 @@ mapped ~~~~~~ -**type**: ``boolean`` +**type**: ``boolean`` **default**: ``true`` If you wish the field to be ignored when reading or writing to the object, you can set the ``mapped`` option to ``false``. From 39f92e9d1bf9a06091bb3940ea840743077cee63 Mon Sep 17 00:00:00 2001 From: Johan Desmyter Date: Fri, 3 Jan 2014 22:39:13 +0300 Subject: [PATCH 2/7] document auto_initialize overriden option --- reference/forms/types/button.rst | 4 ++++ .../forms/types/options/button_auto_initialize.rst.inc | 7 +++++++ 2 files changed, 11 insertions(+) create mode 100644 reference/forms/types/options/button_auto_initialize.rst.inc diff --git a/reference/forms/types/button.rst b/reference/forms/types/button.rst index 5c73b5f34e1..44bf65a90b7 100644 --- a/reference/forms/types/button.rst +++ b/reference/forms/types/button.rst @@ -18,6 +18,8 @@ A simple, non-responsive button. | | - `label_attr`_ | | | - `translation_domain`_ | +----------------------+----------------------------------------------------------------------+ +| Overridden Options | - `auto_initialize` | ++----------------------+----------------------------------------------------------------------+ | Parent type | none | +----------------------+----------------------------------------------------------------------+ | Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\ButtonType` | @@ -35,3 +37,5 @@ Options .. include:: /reference/forms/types/options/label_attr.rst.inc .. include:: /reference/forms/types/options/button_translation_domain.rst.inc + +.. include:: /reference/forms/types/options/button_auto_initialize.rst.inc diff --git a/reference/forms/types/options/button_auto_initialize.rst.inc b/reference/forms/types/options/button_auto_initialize.rst.inc new file mode 100644 index 00000000000..c16ffd843ce --- /dev/null +++ b/reference/forms/types/options/button_auto_initialize.rst.inc @@ -0,0 +1,7 @@ +auto_initialize +~~~~~~~~~~~~~~~ + +**type**: ``boolean`` **default**: ``false`` + +Sets whether the form should be initialized automatically. This option is +not modifiable as buttons do not support automatic initialization. From 17fb12332590bf55812f427ea999d27bca75ee4d Mon Sep 17 00:00:00 2001 From: Johan Desmyter Date: Fri, 3 Jan 2014 22:39:13 +0300 Subject: [PATCH 3/7] document auto_initialize overriden option --- reference/forms/types/button.rst | 4 ++++ .../forms/types/options/button_auto_initialize.rst.inc | 7 +++++++ 2 files changed, 11 insertions(+) create mode 100644 reference/forms/types/options/button_auto_initialize.rst.inc diff --git a/reference/forms/types/button.rst b/reference/forms/types/button.rst index 5c73b5f34e1..44bf65a90b7 100644 --- a/reference/forms/types/button.rst +++ b/reference/forms/types/button.rst @@ -18,6 +18,8 @@ A simple, non-responsive button. | | - `label_attr`_ | | | - `translation_domain`_ | +----------------------+----------------------------------------------------------------------+ +| Overridden Options | - `auto_initialize` | ++----------------------+----------------------------------------------------------------------+ | Parent type | none | +----------------------+----------------------------------------------------------------------+ | Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\ButtonType` | @@ -35,3 +37,5 @@ Options .. include:: /reference/forms/types/options/label_attr.rst.inc .. include:: /reference/forms/types/options/button_translation_domain.rst.inc + +.. include:: /reference/forms/types/options/button_auto_initialize.rst.inc diff --git a/reference/forms/types/options/button_auto_initialize.rst.inc b/reference/forms/types/options/button_auto_initialize.rst.inc new file mode 100644 index 00000000000..c16ffd843ce --- /dev/null +++ b/reference/forms/types/options/button_auto_initialize.rst.inc @@ -0,0 +1,7 @@ +auto_initialize +~~~~~~~~~~~~~~~ + +**type**: ``boolean`` **default**: ``false`` + +Sets whether the form should be initialized automatically. This option is +not modifiable as buttons do not support automatic initialization. From ef807bf27a30c377b2205ce6d71752b26b7fbb91 Mon Sep 17 00:00:00 2001 From: Johan Desmyter Date: Sat, 4 Jan 2014 22:10:07 +0300 Subject: [PATCH 4/7] correct overriden option of button and add checkbox overriden option --- reference/forms/types/button.rst | 5 +- reference/forms/types/checkbox.rst | 48 +++++++++++-------- .../types/options/checkbox_compound.rst.inc | 6 +++ .../types/options/checkbox_empty_data.rst.inc | 6 +++ 4 files changed, 45 insertions(+), 20 deletions(-) create mode 100644 reference/forms/types/options/checkbox_compound.rst.inc create mode 100644 reference/forms/types/options/checkbox_empty_data.rst.inc diff --git a/reference/forms/types/button.rst b/reference/forms/types/button.rst index 44bf65a90b7..94b74b157dc 100644 --- a/reference/forms/types/button.rst +++ b/reference/forms/types/button.rst @@ -18,7 +18,7 @@ A simple, non-responsive button. | | - `label_attr`_ | | | - `translation_domain`_ | +----------------------+----------------------------------------------------------------------+ -| Overridden Options | - `auto_initialize` | +| Overriden options | - `auto_initialize`_ | +----------------------+----------------------------------------------------------------------+ | Parent type | none | +----------------------+----------------------------------------------------------------------+ @@ -38,4 +38,7 @@ Options .. include:: /reference/forms/types/options/button_translation_domain.rst.inc +Overriden options +----------------- + .. include:: /reference/forms/types/options/button_auto_initialize.rst.inc diff --git a/reference/forms/types/checkbox.rst b/reference/forms/types/checkbox.rst index adb6f8d1b24..04258d6704c 100644 --- a/reference/forms/types/checkbox.rst +++ b/reference/forms/types/checkbox.rst @@ -8,25 +8,28 @@ 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. -+-------------+------------------------------------------------------------------------+ -| Rendered as | ``input`` ``checkbox`` field | -+-------------+------------------------------------------------------------------------+ -| Options | - `value`_ | -+-------------+------------------------------------------------------------------------+ -| Inherited | - `data`_ | -| options | - `required`_ | -| | - `label`_ | -| | - `label_attr`_ | -| | - `read_only`_ | -| | - `disabled`_ | -| | - `error_bubbling`_ | -| | - `error_mapping`_ | -| | - `mapped`_ | -+-------------+------------------------------------------------------------------------+ -| Parent type | :doc:`form ` | -+-------------+------------------------------------------------------------------------+ -| Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\CheckboxType` | -+-------------+------------------------------------------------------------------------+ ++--------------------+------------------------------------------------------------------------+ +| Rendered as | ``input`` ``checkbox`` field | ++--------------------+------------------------------------------------------------------------+ +| Options | - `value`_ | ++--------------------+------------------------------------------------------------------------+ +| Overriden options | - `empty_data`_ | +| | - `compound`_ | ++--------------------+------------------------------------------------------------------------+ +| Inherited options | - `data`_ | +| | - `required`_ | +| | - `label`_ | +| | - `label_attr`_ | +| | - `read_only`_ | +| | - `disabled`_ | +| | - `error_bubbling`_ | +| | - `error_mapping`_ | +| | - `mapped`_ | ++--------------------+------------------------------------------------------------------------+ +| Parent type | :doc:`form ` | ++--------------------+------------------------------------------------------------------------+ +| Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\CheckboxType` | ++--------------------+------------------------------------------------------------------------+ Example Usage ------------- @@ -53,6 +56,13 @@ not affect the value that's set on your object. To make a checkbox checked by default, set the `data`_ option to ``true``. +Overriden options +----------------- + +.. include:: /reference/forms/types/options/checkbox_empty_data.rst.inc + +.. include:: /reference/forms/types/options/checkbox_compound.rst.inc + Inherited options ----------------- diff --git a/reference/forms/types/options/checkbox_compound.rst.inc b/reference/forms/types/options/checkbox_compound.rst.inc new file mode 100644 index 00000000000..e7149eb8924 --- /dev/null +++ b/reference/forms/types/options/checkbox_compound.rst.inc @@ -0,0 +1,6 @@ +compound +~~~~~~~~ + +**type**: ``boolean`` **default**: ``false`` + +Specify that checkbox type is not a combined type. diff --git a/reference/forms/types/options/checkbox_empty_data.rst.inc b/reference/forms/types/options/checkbox_empty_data.rst.inc new file mode 100644 index 00000000000..987d7247458 --- /dev/null +++ b/reference/forms/types/options/checkbox_empty_data.rst.inc @@ -0,0 +1,6 @@ +empty_data +~~~~~~~~~~ + +**type**: ``closure`` + + From b2c4f51e5f0d81db9b05be6d1877d22c88e0eefe Mon Sep 17 00:00:00 2001 From: Johan Desmyter Date: Sat, 4 Jan 2014 22:10:07 +0300 Subject: [PATCH 5/7] correct overriden option of button and add checkbox overriden option --- reference/forms/types/button.rst | 5 +- reference/forms/types/checkbox.rst | 48 +++++++++++-------- .../types/options/checkbox_compound.rst.inc | 6 +++ .../types/options/checkbox_empty_data.rst.inc | 6 +++ 4 files changed, 45 insertions(+), 20 deletions(-) create mode 100644 reference/forms/types/options/checkbox_compound.rst.inc create mode 100644 reference/forms/types/options/checkbox_empty_data.rst.inc diff --git a/reference/forms/types/button.rst b/reference/forms/types/button.rst index 44bf65a90b7..94b74b157dc 100644 --- a/reference/forms/types/button.rst +++ b/reference/forms/types/button.rst @@ -18,7 +18,7 @@ A simple, non-responsive button. | | - `label_attr`_ | | | - `translation_domain`_ | +----------------------+----------------------------------------------------------------------+ -| Overridden Options | - `auto_initialize` | +| Overriden options | - `auto_initialize`_ | +----------------------+----------------------------------------------------------------------+ | Parent type | none | +----------------------+----------------------------------------------------------------------+ @@ -38,4 +38,7 @@ Options .. include:: /reference/forms/types/options/button_translation_domain.rst.inc +Overriden options +----------------- + .. include:: /reference/forms/types/options/button_auto_initialize.rst.inc diff --git a/reference/forms/types/checkbox.rst b/reference/forms/types/checkbox.rst index adb6f8d1b24..04258d6704c 100644 --- a/reference/forms/types/checkbox.rst +++ b/reference/forms/types/checkbox.rst @@ -8,25 +8,28 @@ 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. -+-------------+------------------------------------------------------------------------+ -| Rendered as | ``input`` ``checkbox`` field | -+-------------+------------------------------------------------------------------------+ -| Options | - `value`_ | -+-------------+------------------------------------------------------------------------+ -| Inherited | - `data`_ | -| options | - `required`_ | -| | - `label`_ | -| | - `label_attr`_ | -| | - `read_only`_ | -| | - `disabled`_ | -| | - `error_bubbling`_ | -| | - `error_mapping`_ | -| | - `mapped`_ | -+-------------+------------------------------------------------------------------------+ -| Parent type | :doc:`form ` | -+-------------+------------------------------------------------------------------------+ -| Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\CheckboxType` | -+-------------+------------------------------------------------------------------------+ ++--------------------+------------------------------------------------------------------------+ +| Rendered as | ``input`` ``checkbox`` field | ++--------------------+------------------------------------------------------------------------+ +| Options | - `value`_ | ++--------------------+------------------------------------------------------------------------+ +| Overriden options | - `empty_data`_ | +| | - `compound`_ | ++--------------------+------------------------------------------------------------------------+ +| Inherited options | - `data`_ | +| | - `required`_ | +| | - `label`_ | +| | - `label_attr`_ | +| | - `read_only`_ | +| | - `disabled`_ | +| | - `error_bubbling`_ | +| | - `error_mapping`_ | +| | - `mapped`_ | ++--------------------+------------------------------------------------------------------------+ +| Parent type | :doc:`form ` | ++--------------------+------------------------------------------------------------------------+ +| Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\CheckboxType` | ++--------------------+------------------------------------------------------------------------+ Example Usage ------------- @@ -53,6 +56,13 @@ not affect the value that's set on your object. To make a checkbox checked by default, set the `data`_ option to ``true``. +Overriden options +----------------- + +.. include:: /reference/forms/types/options/checkbox_empty_data.rst.inc + +.. include:: /reference/forms/types/options/checkbox_compound.rst.inc + Inherited options ----------------- diff --git a/reference/forms/types/options/checkbox_compound.rst.inc b/reference/forms/types/options/checkbox_compound.rst.inc new file mode 100644 index 00000000000..e7149eb8924 --- /dev/null +++ b/reference/forms/types/options/checkbox_compound.rst.inc @@ -0,0 +1,6 @@ +compound +~~~~~~~~ + +**type**: ``boolean`` **default**: ``false`` + +Specify that checkbox type is not a combined type. diff --git a/reference/forms/types/options/checkbox_empty_data.rst.inc b/reference/forms/types/options/checkbox_empty_data.rst.inc new file mode 100644 index 00000000000..987d7247458 --- /dev/null +++ b/reference/forms/types/options/checkbox_empty_data.rst.inc @@ -0,0 +1,6 @@ +empty_data +~~~~~~~~~~ + +**type**: ``closure`` + + From 8e3db136d6d7dc376fb5d2fa738fa5be8cedc63c Mon Sep 17 00:00:00 2001 From: Johan Desmyter Date: Sun, 12 Jan 2014 07:35:13 +0300 Subject: [PATCH 6/7] document overriden options of checkbox --- reference/forms/types/options/checkbox_compound.rst.inc | 4 +++- reference/forms/types/options/checkbox_empty_data.rst.inc | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/reference/forms/types/options/checkbox_compound.rst.inc b/reference/forms/types/options/checkbox_compound.rst.inc index e7149eb8924..855969d870c 100644 --- a/reference/forms/types/options/checkbox_compound.rst.inc +++ b/reference/forms/types/options/checkbox_compound.rst.inc @@ -3,4 +3,6 @@ compound **type**: ``boolean`` **default**: ``false`` -Specify that checkbox type is not a combined type. +This option specifies if a form is compound. As it's not the +case for checkbox, by fefault the value is overriden with +``false`` value. diff --git a/reference/forms/types/options/checkbox_empty_data.rst.inc b/reference/forms/types/options/checkbox_empty_data.rst.inc index 987d7247458..fa7f23d5ca3 100644 --- a/reference/forms/types/options/checkbox_empty_data.rst.inc +++ b/reference/forms/types/options/checkbox_empty_data.rst.inc @@ -1,6 +1,10 @@ empty_data ~~~~~~~~~~ -**type**: ``closure`` +**type**: ``string`` **default**: ``mixed`` +This option determines what value the field will return when the ``empty_value`` +choice is selected. +In checkbox, the value of ``empty_data`` is overriden by the value returned by +the data transformer (see :doc:`/cookbook/form/data_transformers.rst`). From 2ed6d413856b9c5124b5e41efc9fefa638192824 Mon Sep 17 00:00:00 2001 From: Johan Desmyter Date: Sun, 12 Jan 2014 08:12:10 +0300 Subject: [PATCH 7/7] document overriden options of choice field --- reference/forms/types/choice.rst | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/reference/forms/types/choice.rst b/reference/forms/types/choice.rst index b69e48c32ed..32d364a8e2d 100644 --- a/reference/forms/types/choice.rst +++ b/reference/forms/types/choice.rst @@ -20,18 +20,20 @@ option. | | - `preferred_choices`_ | | | - `empty_value`_ | +-------------+------------------------------------------------------------------------------+ +| Overriden | - `empty_data`_ | +| options | - `compound`_ | +| | - `error_bubbling`_ | ++-------------+------------------------------------------------------------------------------+ | Inherited | - `required`_ | | options | - `label`_ | | | - `label_attr`_ | | | - `data`_ | | | - `read_only`_ | | | - `disabled`_ | -| | - `error_bubbling`_ | | | - `error_mapping`_ | | | - `mapped`_ | | | - `inherit_data`_ | | | - `by_reference`_ | -| | - `empty_data`_ | +-------------+------------------------------------------------------------------------------+ | Parent type | :doc:`form ` | +-------------+------------------------------------------------------------------------------+ @@ -109,6 +111,27 @@ can be created to supply the choices. .. include:: /reference/forms/types/options/empty_value.rst.inc +Overriden options +----------------- + +.. include:: /reference/forms/types/options/empty_data.rst.inc + +compound +~~~~~~~~ + +**type**: `̀ boolean`` **default**: same value as ``expanded`` option + +This option specifies if a form is compound. The value is by default +overriden by the value of the ``expanded`` option. + +error_bubbling +~~~~~~~~~~~~~~ + +**type**: ``boolean`` **default**: ``false`` + +Set that error on this field must be attached to the field instead of +the parent field (the form in most cases). + Inherited options ----------------- @@ -126,8 +149,6 @@ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/disabled.rst.inc -.. include:: /reference/forms/types/options/error_bubbling.rst.inc - .. include:: /reference/forms/types/options/error_mapping.rst.inc .. include:: /reference/forms/types/options/mapped.rst.inc @@ -135,5 +156,3 @@ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/inherit_data.rst.inc .. include:: /reference/forms/types/options/by_reference.rst.inc - -.. include:: /reference/forms/types/options/empty_data.rst.inc