diff --git a/reference/forms/types/birthday.rst b/reference/forms/types/birthday.rst index dcc4786b345..2d8475eb04c 100644 --- a/reference/forms/types/birthday.rst +++ b/reference/forms/types/birthday.rst @@ -30,6 +30,7 @@ option defaults to 120 years ago to the current year. | | - `format`_ | | | - `model_timezone`_ | | | - `view_timezone`_ | +| | - `data`_ | | | - `invalid_message`_ | | | - `invalid_message_parameters`_ | | | - `read_only`_ | @@ -76,6 +77,8 @@ These options inherit from the :doc:`date ` type: These options inherit from the :doc:`form ` type: +.. include:: /reference/forms/types/options/data.rst.inc + .. include:: /reference/forms/types/options/invalid_message.rst.inc .. include:: /reference/forms/types/options/invalid_message_parameters.rst.inc diff --git a/reference/forms/types/checkbox.rst b/reference/forms/types/checkbox.rst index ddefd70ee06..48a520780ca 100644 --- a/reference/forms/types/checkbox.rst +++ b/reference/forms/types/checkbox.rst @@ -50,7 +50,7 @@ not affect the value that's set on your object. .. caution:: - To make a checkbox checked by default, use the `data`_ option. + To make a checkbox checked by default, set the `data`_ option to ``true``. Inherited options ----------------- diff --git a/reference/forms/types/choice.rst b/reference/forms/types/choice.rst index 551db27c551..3d09602ee62 100644 --- a/reference/forms/types/choice.rst +++ b/reference/forms/types/choice.rst @@ -22,6 +22,7 @@ option. +-------------+------------------------------------------------------------------------------+ | Inherited | - `required`_ | | options | - `label`_ | +| | - `data`_ | | | - `read_only`_ | | | - `disabled`_ | | | - `error_bubbling`_ | @@ -116,6 +117,8 @@ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/label.rst.inc +.. include:: /reference/forms/types/options/data.rst.inc + .. include:: /reference/forms/types/options/read_only.rst.inc .. include:: /reference/forms/types/options/disabled.rst.inc diff --git a/reference/forms/types/collection.rst b/reference/forms/types/collection.rst index decc14e5e93..beb87d8a961 100644 --- a/reference/forms/types/collection.rst +++ b/reference/forms/types/collection.rst @@ -341,10 +341,6 @@ Not all options are listed here - only the most applicable to this type: .. include:: /reference/forms/types/options/label.rst.inc -.. include:: /reference/forms/types/options/mapped.rst.inc - -.. include:: /reference/forms/types/options/error_mapping.rst.inc - error_bubbling ~~~~~~~~~~~~~~ @@ -352,8 +348,12 @@ error_bubbling .. include:: /reference/forms/types/options/_error_bubbling_body.rst.inc +.. include:: /reference/forms/types/options/error_mapping.rst.inc + .. _reference-form-types-by-reference: .. include:: /reference/forms/types/options/by_reference.rst.inc .. include:: /reference/forms/types/options/empty_data.rst.inc + +.. include:: /reference/forms/types/options/mapped.rst.inc diff --git a/reference/forms/types/country.rst b/reference/forms/types/country.rst index 8d60cb91d98..059be6b3305 100644 --- a/reference/forms/types/country.rst +++ b/reference/forms/types/country.rst @@ -33,6 +33,7 @@ you should just use the ``choice`` type directly. | | - `error_mapping`_ | | | - `required`_ | | | - `label`_ | +| | - `data`_ | | | - `read_only`_ | | | - `disabled`_ | | | - `mapped`_ | @@ -76,6 +77,8 @@ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/label.rst.inc +.. include:: /reference/forms/types/options/data.rst.inc + .. include:: /reference/forms/types/options/read_only.rst.inc .. include:: /reference/forms/types/options/disabled.rst.inc diff --git a/reference/forms/types/currency.rst b/reference/forms/types/currency.rst index d921ce09a1b..76c0f117c75 100644 --- a/reference/forms/types/currency.rst +++ b/reference/forms/types/currency.rst @@ -26,6 +26,7 @@ should just use the ``choice`` type directly. | | - `error_bubbling`_ | | | - `required`_ | | | - `label`_ | +| | - `data`_ | | | - `read_only`_ | | | - `disabled`_ | | | - `mapped`_ | @@ -60,12 +61,14 @@ These options inherit from the :doc:`choice` type .. include:: /reference/forms/types/options/error_bubbling.rst.inc -These options inherit from the :doc:`date` type: +These options inherit from the :doc:`form` type: .. include:: /reference/forms/types/options/required.rst.inc .. include:: /reference/forms/types/options/label.rst.inc +.. include:: /reference/forms/types/options/data.rst.inc + .. include:: /reference/forms/types/options/read_only.rst.inc .. include:: /reference/forms/types/options/disabled.rst.inc diff --git a/reference/forms/types/date.rst b/reference/forms/types/date.rst index c2fe15c3c07..4e5d284e7cd 100644 --- a/reference/forms/types/date.rst +++ b/reference/forms/types/date.rst @@ -32,8 +32,9 @@ day, and year) or three select boxes (see the `widget`_ option). | Overridden Options | - `by_reference`_ | | | - `error_bubbling`_ | +----------------------+-----------------------------------------------------------------------------+ -| Inherited | - `invalid_message`_ | -| options | - `invalid_message_parameters`_ | +| Inherited | - `data`_ | +| options | - `invalid_message`_ | +| | - `invalid_message_parameters`_ | | | - `read_only`_ | | | - `disabled`_ | | | - `mapped`_ | @@ -138,6 +139,8 @@ Inherited options These options inherit from the :doc:`form ` type: +.. include:: /reference/forms/types/options/data.rst.inc + .. include:: /reference/forms/types/options/invalid_message.rst.inc .. include:: /reference/forms/types/options/invalid_message_parameters.rst.inc diff --git a/reference/forms/types/datetime.rst b/reference/forms/types/datetime.rst index 1b59ddff52e..e607655f03e 100644 --- a/reference/forms/types/datetime.rst +++ b/reference/forms/types/datetime.rst @@ -31,8 +31,9 @@ data can be a ``DateTime`` object, a string, a timestamp or an array. | | - `view_timezone`_ | | | - `empty_value`_ | +----------------------+-----------------------------------------------------------------------------+ -| Inherited | - `invalid_message`_ | -| options | - `invalid_message_parameters`_ | +| Inherited | - `data`_ | +| options | - `invalid_message`_ | +| | - `invalid_message_parameters`_ | | | - `read_only`_ | | | - `disabled`_ | | | - `mapped`_ | @@ -121,6 +122,8 @@ Inherited options These options inherit from the :doc:`form ` type: +.. include:: /reference/forms/types/options/data.rst.inc + .. include:: /reference/forms/types/options/invalid_message.rst.inc .. include:: /reference/forms/types/options/invalid_message_parameters.rst.inc diff --git a/reference/forms/types/email.rst b/reference/forms/types/email.rst index fb6ca9a2868..209c0f65cd6 100644 --- a/reference/forms/types/email.rst +++ b/reference/forms/types/email.rst @@ -13,6 +13,7 @@ The ``email`` field is a text field that is rendered using the HTML5 | Inherited | - `max_length`_ | | options | - `required`_ | | | - `label`_ | +| | - `data`_ | | | - `trim`_ | | | - `read_only`_ | | | - `disabled`_ | @@ -36,6 +37,8 @@ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/label.rst.inc +.. include:: /reference/forms/types/options/data.rst.inc + .. include:: /reference/forms/types/options/trim.rst.inc .. include:: /reference/forms/types/options/read_only.rst.inc diff --git a/reference/forms/types/entity.rst b/reference/forms/types/entity.rst index 29b73c2b4af..2b3c9e8cf88 100644 --- a/reference/forms/types/entity.rst +++ b/reference/forms/types/entity.rst @@ -21,12 +21,13 @@ objects from the database. | Overridden | - `choices`_ | | Options | - `choice_list`_ | +-------------+------------------------------------------------------------------+ -| Inherited | - `required`_ | -| options | - `label`_ | -| | - `multiple`_ | -| | - `expanded`_ | +| Inherited | - `multiple`_ | +| options | - `expanded`_ | | | - `preferred_choices`_ | | | - `empty_value`_ | +| | - `required`_ | +| | - `label`_ | +| | - `data`_ | | | - `read_only`_ | | | - `disabled`_ | | | - `error_bubbling`_ | @@ -190,6 +191,8 @@ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/label.rst.inc +.. include:: /reference/forms/types/options/data.rst.inc + .. include:: /reference/forms/types/options/read_only.rst.inc .. include:: /reference/forms/types/options/disabled.rst.inc diff --git a/reference/forms/types/integer.rst b/reference/forms/types/integer.rst index b11d906e4a4..af4d61676cf 100644 --- a/reference/forms/types/integer.rst +++ b/reference/forms/types/integer.rst @@ -21,6 +21,7 @@ integers. By default, all non-integer values (e.g. 6.78) will round down (e.g. 6 +-------------+-----------------------------------------------------------------------+ | Inherited | - `required`_ | | options | - `label`_ | +| | - `data`_ | | | - `read_only`_ | | | - `disabled`_ | | | - `error_bubbling`_ | @@ -71,6 +72,8 @@ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/label.rst.inc +.. include:: /reference/forms/types/options/data.rst.inc + .. include:: /reference/forms/types/options/read_only.rst.inc .. include:: /reference/forms/types/options/disabled.rst.inc diff --git a/reference/forms/types/language.rst b/reference/forms/types/language.rst index dc83dd0d903..ff1056ee4bf 100644 --- a/reference/forms/types/language.rst +++ b/reference/forms/types/language.rst @@ -34,6 +34,7 @@ you should just use the ``choice`` type directly. | | - `error_mapping`_ | | | - `required`_ | | | - `label`_ | +| | - `data`_ | | | - `read_only`_ | | | - `disabled`_ | | | - `mapped`_ | @@ -77,6 +78,8 @@ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/label.rst.inc +.. include:: /reference/forms/types/options/data.rst.inc + .. include:: /reference/forms/types/options/read_only.rst.inc .. include:: /reference/forms/types/options/disabled.rst.inc diff --git a/reference/forms/types/locale.rst b/reference/forms/types/locale.rst index 6a5378c87dc..df7878997bf 100644 --- a/reference/forms/types/locale.rst +++ b/reference/forms/types/locale.rst @@ -36,6 +36,7 @@ you should just use the ``choice`` type directly. | | - `error_mapping`_ | | | - `required`_ | | | - `label`_ | +| | - `data`_ | | | - `read_only`_ | | | - `disabled`_ | | | - `mapped`_ | @@ -79,6 +80,8 @@ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/label.rst.inc +.. include:: /reference/forms/types/options/data.rst.inc + .. include:: /reference/forms/types/options/read_only.rst.inc .. include:: /reference/forms/types/options/disabled.rst.inc diff --git a/reference/forms/types/money.rst b/reference/forms/types/money.rst index 06dfdb7c2c1..79e77a43baa 100644 --- a/reference/forms/types/money.rst +++ b/reference/forms/types/money.rst @@ -21,6 +21,7 @@ how the input and output of the data is handled. +-------------+---------------------------------------------------------------------+ | Inherited | - `required`_ | | options | - `label`_ | +| | - `data`_ | | | - `read_only`_ | | | - `disabled`_ | | | - `error_bubbling`_ | @@ -89,6 +90,8 @@ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/label.rst.inc +.. include:: /reference/forms/types/options/data.rst.inc + .. include:: /reference/forms/types/options/read_only.rst.inc .. include:: /reference/forms/types/options/disabled.rst.inc diff --git a/reference/forms/types/number.rst b/reference/forms/types/number.rst index 29f793cd866..e51ff91b03e 100644 --- a/reference/forms/types/number.rst +++ b/reference/forms/types/number.rst @@ -17,6 +17,7 @@ you want to use for your number. +-------------+----------------------------------------------------------------------+ | Inherited | - `required`_ | | options | - `label`_ | +| | - `data`_ | | | - `read_only`_ | | | - `disabled`_ | | | - `error_bubbling`_ | @@ -79,6 +80,8 @@ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/label.rst.inc +.. include:: /reference/forms/types/options/data.rst.inc + .. include:: /reference/forms/types/options/read_only.rst.inc .. include:: /reference/forms/types/options/disabled.rst.inc diff --git a/reference/forms/types/options/data.rst.inc b/reference/forms/types/options/data.rst.inc index d04ec4e76d7..45f0b972cec 100644 --- a/reference/forms/types/options/data.rst.inc +++ b/reference/forms/types/options/data.rst.inc @@ -12,4 +12,8 @@ an individual field, you can set it in the data option:: 'data' => 'abcdef', )); +.. 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. diff --git a/reference/forms/types/percent.rst b/reference/forms/types/percent.rst index 4073602351d..1a2b3ee4146 100644 --- a/reference/forms/types/percent.rst +++ b/reference/forms/types/percent.rst @@ -20,6 +20,7 @@ This field adds a percentage sign "``%``" after the input box. +-------------+-----------------------------------------------------------------------+ | Inherited | - `required`_ | | options | - `label`_ | +| | - `data`_ | | | - `read_only`_ | | | - `disabled`_ | | | - `error_bubbling`_ | @@ -73,6 +74,8 @@ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/label.rst.inc +.. include:: /reference/forms/types/options/data.rst.inc + .. include:: /reference/forms/types/options/read_only.rst.inc .. include:: /reference/forms/types/options/disabled.rst.inc diff --git a/reference/forms/types/repeated.rst b/reference/forms/types/repeated.rst index c672c8e5971..fbdb5dd5fb7 100644 --- a/reference/forms/types/repeated.rst +++ b/reference/forms/types/repeated.rst @@ -22,8 +22,9 @@ accuracy. | Overridden | - `error_bubbling`_ | | Options | | +-------------+------------------------------------------------------------------------+ -| Inherited | - `invalid_message`_ | -| options | - `invalid_message_parameters`_ | +| Inherited | - `data`_ | +| options | - `invalid_message`_ | +| | - `invalid_message_parameters`_ | | | - `mapped`_ | | | - `error_mapping`_ | +-------------+------------------------------------------------------------------------+ @@ -182,6 +183,8 @@ Inherited options These options inherit from the :doc:`form ` type: +.. include:: /reference/forms/types/options/data.rst.inc + .. include:: /reference/forms/types/options/invalid_message.rst.inc .. include:: /reference/forms/types/options/invalid_message_parameters.rst.inc diff --git a/reference/forms/types/text.rst b/reference/forms/types/text.rst index bd7465a6ac7..60061e35a8f 100644 --- a/reference/forms/types/text.rst +++ b/reference/forms/types/text.rst @@ -12,6 +12,7 @@ The text field represents the most basic input text field. | Inherited | - `max_length`_ | | options | - `required`_ | | | - `label`_ | +| | - `data`_ | | | - `trim`_ | | | - `read_only`_ | | | - `disabled`_ | @@ -36,6 +37,8 @@ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/label.rst.inc +.. include:: /reference/forms/types/options/data.rst.inc + .. include:: /reference/forms/types/options/trim.rst.inc .. include:: /reference/forms/types/options/read_only.rst.inc diff --git a/reference/forms/types/textarea.rst b/reference/forms/types/textarea.rst index 0b64c9205b5..d03c6fa4c71 100644 --- a/reference/forms/types/textarea.rst +++ b/reference/forms/types/textarea.rst @@ -13,6 +13,7 @@ Renders a ``textarea`` HTML element. | options | - `required`_ | | | - `label`_ | | | - `trim`_ | +| | - `data`_ | | | - `read_only`_ | | | - `disabled`_ | | | - `error_bubbling`_ | @@ -37,6 +38,8 @@ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/trim.rst.inc +.. include:: /reference/forms/types/options/data.rst.inc + .. include:: /reference/forms/types/options/read_only.rst.inc .. include:: /reference/forms/types/options/disabled.rst.inc diff --git a/reference/forms/types/time.rst b/reference/forms/types/time.rst index cb8fc6b91e8..4a203498615 100644 --- a/reference/forms/types/time.rst +++ b/reference/forms/types/time.rst @@ -30,6 +30,7 @@ as a ``DateTime`` object, a string, a timestamp or an array. +----------------------+-----------------------------------------------------------------------------+ | Inherited | - `invalid_message`_ | | options | - `invalid_message_parameters`_ | +| | - `data`_ | | | - `read_only`_ | | | - `disabled`_ | | | - `mapped`_ | @@ -143,6 +144,8 @@ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/invalid_message_parameters.rst.inc +.. include:: /reference/forms/types/options/data.rst.inc + .. include:: /reference/forms/types/options/read_only.rst.inc .. include:: /reference/forms/types/options/disabled.rst.inc diff --git a/reference/forms/types/timezone.rst b/reference/forms/types/timezone.rst index d77baecdb3b..cb9e133d002 100644 --- a/reference/forms/types/timezone.rst +++ b/reference/forms/types/timezone.rst @@ -27,6 +27,7 @@ you should just use the ``choice`` type directly. | | - `empty_value`_ | | | - `required`_ | | | - `label`_ | +| | - `data`_ | | | - `read_only`_ | | | - `disabled`_ | | | - `error_bubbling`_ | @@ -68,6 +69,8 @@ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/label.rst.inc +.. include:: /reference/forms/types/options/data.rst.inc + .. include:: /reference/forms/types/options/read_only.rst.inc .. include:: /reference/forms/types/options/disabled.rst.inc diff --git a/reference/forms/types/url.rst b/reference/forms/types/url.rst index ad94a4c571d..f78ef083b3b 100644 --- a/reference/forms/types/url.rst +++ b/reference/forms/types/url.rst @@ -16,6 +16,7 @@ have a protocol. | Inherited | - `max_length`_ | | options | - `required`_ | | | - `label`_ | +| | - `data`_ | | | - `trim`_ | | | - `read_only`_ | | | - `disabled`_ | @@ -51,6 +52,8 @@ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/label.rst.inc +.. include:: /reference/forms/types/options/data.rst.inc + .. include:: /reference/forms/types/options/trim.rst.inc .. include:: /reference/forms/types/options/read_only.rst.inc