From 4c929e73a5c3df39f8ed4b85a90f0b193ef7c814 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 11 Sep 2019 12:40:10 +0200 Subject: [PATCH] [Form] Added the attr_row option to all form types --- reference/forms/types/birthday.rst | 6 ++++++ reference/forms/types/button.rst | 3 +++ reference/forms/types/checkbox.rst | 10 ++++++++-- reference/forms/types/choice.rst | 3 +++ reference/forms/types/collection.rst | 10 ++++++++-- reference/forms/types/color.rst | 10 ++++++++-- reference/forms/types/country.rst | 6 ++++++ reference/forms/types/currency.rst | 6 ++++++ reference/forms/types/date.rst | 10 ++++++++-- reference/forms/types/dateinterval.rst | 10 ++++++++-- reference/forms/types/datetime.rst | 10 ++++++++-- reference/forms/types/email.rst | 10 ++++++++-- reference/forms/types/entity.rst | 3 +++ reference/forms/types/file.rst | 10 ++++++++-- reference/forms/types/form.rst | 3 +++ reference/forms/types/hidden.rst | 10 ++++++++-- reference/forms/types/integer.rst | 10 ++++++++-- reference/forms/types/language.rst | 6 ++++++ reference/forms/types/locale.rst | 6 ++++++ reference/forms/types/money.rst | 10 ++++++++-- reference/forms/types/number.rst | 10 ++++++++-- reference/forms/types/options/attr.rst.inc | 5 +++++ .../forms/types/options/row_attr.rst.inc | 20 +++++++++++++++++++ reference/forms/types/password.rst | 10 ++++++++-- reference/forms/types/percent.rst | 10 ++++++++-- reference/forms/types/radio.rst | 6 ++++++ reference/forms/types/range.rst | 3 +++ reference/forms/types/repeated.rst | 10 ++++++++-- reference/forms/types/reset.rst | 3 +++ reference/forms/types/search.rst | 10 ++++++++-- reference/forms/types/submit.rst | 3 +++ reference/forms/types/tel.rst | 10 ++++++++-- reference/forms/types/text.rst | 3 +++ reference/forms/types/textarea.rst | 3 +++ reference/forms/types/time.rst | 10 ++++++++-- reference/forms/types/timezone.rst | 6 ++++++ reference/forms/types/url.rst | 10 ++++++++-- 37 files changed, 246 insertions(+), 38 deletions(-) create mode 100644 reference/forms/types/options/row_attr.rst.inc diff --git a/reference/forms/types/birthday.rst b/reference/forms/types/birthday.rst index 540035bec8a..7fd450fbec6 100644 --- a/reference/forms/types/birthday.rst +++ b/reference/forms/types/birthday.rst @@ -37,6 +37,7 @@ option defaults to 120 years ago to the current year. | | | | | from the :doc:`FormType `: | | | | +| | - `attr`_ | | | - `data`_ | | | - `disabled`_ | | | - `help`_ | @@ -46,6 +47,7 @@ option defaults to 120 years ago to the current year. | | - `invalid_message`_ | | | - `invalid_message_parameters`_ | | | - `mapped`_ | +| | - `row_attr`_ | +----------------------+-------------------------------------------------------------------------------+ | Parent type | :doc:`DateType ` | +----------------------+-------------------------------------------------------------------------------+ @@ -112,6 +114,8 @@ values for the year, month and day fields:: These options inherit from the :doc:`FormType `: +.. include:: /reference/forms/types/options/attr.rst.inc + .. include:: /reference/forms/types/options/data.rst.inc .. include:: /reference/forms/types/options/disabled.rst.inc @@ -129,3 +133,5 @@ These options inherit from the :doc:`FormType `: .. include:: /reference/forms/types/options/invalid_message_parameters.rst.inc .. include:: /reference/forms/types/options/mapped.rst.inc + +.. include:: /reference/forms/types/options/row_attr.rst.inc diff --git a/reference/forms/types/button.rst b/reference/forms/types/button.rst index d009b80235e..6c07c3656cc 100644 --- a/reference/forms/types/button.rst +++ b/reference/forms/types/button.rst @@ -14,6 +14,7 @@ A simple, non-responsive button. | | - `disabled`_ | | | - `label`_ | | | - `label_translation_parameters`_ | +| | - `row_attr`_ | | | - `translation_domain`_ | +----------------------+----------------------------------------------------------------------+ | Parent type | none | @@ -91,3 +92,5 @@ option of its parents, so buttons can reuse and/or override any of the parent placeholders. .. include:: /reference/forms/types/options/attr_translation_parameters.rst.inc + +.. include:: /reference/forms/types/options/row_attr.rst.inc diff --git a/reference/forms/types/checkbox.rst b/reference/forms/types/checkbox.rst index e5b23ab68a1..aef03ef1e44 100644 --- a/reference/forms/types/checkbox.rst +++ b/reference/forms/types/checkbox.rst @@ -20,8 +20,9 @@ if you want to handle submitted values like "0" or "false"). | Overridden | - `compound`_ | | options | - `empty_data`_ | +-------------+------------------------------------------------------------------------+ -| Inherited | - `data`_ | -| options | - `disabled`_ | +| Inherited | - `attr`_ | +| options | - `data`_ | +| | - `disabled`_ | | | - `error_bubbling`_ | | | - `error_mapping`_ | | | - `help`_ | @@ -32,6 +33,7 @@ if you want to handle submitted values like "0" or "false"). | | - `label_format`_ | | | - `mapped`_ | | | - `required`_ | +| | - `row_attr`_ | +-------------+------------------------------------------------------------------------+ | Parent type | :doc:`FormType ` | +-------------+------------------------------------------------------------------------+ @@ -77,6 +79,8 @@ Inherited Options These options inherit from the :doc:`FormType `: +.. include:: /reference/forms/types/options/attr.rst.inc + .. include:: /reference/forms/types/options/data.rst.inc .. include:: /reference/forms/types/options/disabled.rst.inc @@ -101,6 +105,8 @@ These options inherit from the :doc:`FormType `: .. include:: /reference/forms/types/options/required.rst.inc +.. include:: /reference/forms/types/options/row_attr.rst.inc + Form Variables -------------- diff --git a/reference/forms/types/choice.rst b/reference/forms/types/choice.rst index fdcf71647a7..16ed48f813a 100644 --- a/reference/forms/types/choice.rst +++ b/reference/forms/types/choice.rst @@ -44,6 +44,7 @@ To use this field, you must specify *either* ``choices`` or ``choice_loader`` op | | - `label_format`_ | | | - `mapped`_ | | | - `required`_ | +| | - `row_attr`_ | | | - `translation_domain`_ | | | - `label_translation_parameters`_ | | | - `attr_translation_parameters`_ | @@ -298,6 +299,8 @@ These options inherit from the :doc:`FormType `: .. include:: /reference/forms/types/options/required.rst.inc +.. include:: /reference/forms/types/options/row_attr.rst.inc + .. include:: /reference/forms/types/options/choice_type_translation_domain.rst.inc .. include:: /reference/forms/types/options/label_translation_parameters.rst.inc diff --git a/reference/forms/types/collection.rst b/reference/forms/types/collection.rst index c0ca2e993ae..cf1e436b68f 100644 --- a/reference/forms/types/collection.rst +++ b/reference/forms/types/collection.rst @@ -23,8 +23,9 @@ photos). | | - `prototype_data`_ | | | - `prototype_name`_ | +-------------+-----------------------------------------------------------------------------+ -| Inherited | - `by_reference`_ | -| options | - `empty_data`_ | +| Inherited | - `attr`_ | +| options | - `by_reference`_ | +| | - `empty_data`_ | | | - `error_bubbling`_ | | | - `error_mapping`_ | | | - `help`_ | @@ -35,6 +36,7 @@ photos). | | - `label_format`_ | | | - `mapped`_ | | | - `required`_ | +| | - `row_attr`_ | +-------------+-----------------------------------------------------------------------------+ | Parent type | :doc:`FormType ` | +-------------+-----------------------------------------------------------------------------+ @@ -400,6 +402,8 @@ Inherited Options These options inherit from the :doc:`FormType `. Not all options are listed here - only the most applicable to this type: +.. include:: /reference/forms/types/options/attr.rst.inc + .. _reference-form-types-by-reference: .. include:: /reference/forms/types/options/by_reference.rst.inc @@ -437,6 +441,8 @@ error_bubbling .. include:: /reference/forms/types/options/required.rst.inc +.. include:: /reference/forms/types/options/row_attr.rst.inc + Field Variables --------------- diff --git a/reference/forms/types/color.rst b/reference/forms/types/color.rst index e601f1e6932..f6e4ec5ba58 100644 --- a/reference/forms/types/color.rst +++ b/reference/forms/types/color.rst @@ -17,8 +17,9 @@ element. +-------------+---------------------------------------------------------------------+ | Rendered as | ``input`` ``color`` field (a text box) | +-------------+---------------------------------------------------------------------+ -| Inherited | - `data`_ | -| options | - `disabled`_ | +| Inherited | - `attr`_ | +| options | - `data`_ | +| | - `disabled`_ | | | - `empty_data`_ | | | - `error_bubbling`_ | | | - `error_mapping`_ | @@ -30,6 +31,7 @@ element. | | - `label_format`_ | | | - `mapped`_ | | | - `required`_ | +| | - `row_attr`_ | | | - `trim`_ | +-------------+---------------------------------------------------------------------+ | Parent type | :doc:`TextType ` | @@ -44,6 +46,8 @@ Inherited Options These options inherit from the :doc:`FormType `: +.. include:: /reference/forms/types/options/attr.rst.inc + .. include:: /reference/forms/types/options/data.rst.inc .. include:: /reference/forms/types/options/disabled.rst.inc @@ -76,4 +80,6 @@ The default value is ``''`` (the empty string). .. include:: /reference/forms/types/options/required.rst.inc +.. include:: /reference/forms/types/options/row_attr.rst.inc + .. include:: /reference/forms/types/options/trim.rst.inc diff --git a/reference/forms/types/country.rst b/reference/forms/types/country.rst index 423d49e4224..dbf2a87cc5b 100644 --- a/reference/forms/types/country.rst +++ b/reference/forms/types/country.rst @@ -38,6 +38,7 @@ the option manually, but then you should just use the ``ChoiceType`` directly. | | | | | from the :doc:`FormType ` | | | | +| | - `attr`_ | | | - `data`_ | | | - `disabled`_ | | | - `empty_data`_ | @@ -49,6 +50,7 @@ the option manually, but then you should just use the ``ChoiceType`` directly. | | - `label_format`_ | | | - `mapped`_ | | | - `required`_ | +| | - `row_attr`_ | +-------------+-----------------------------------------------------------------------+ | Parent type | :doc:`ChoiceType ` | +-------------+-----------------------------------------------------------------------+ @@ -99,6 +101,8 @@ These options inherit from the :doc:`ChoiceType ` These options inherit from the :doc:`FormType `: +.. include:: /reference/forms/types/options/attr.rst.inc + .. include:: /reference/forms/types/options/data.rst.inc .. include:: /reference/forms/types/options/disabled.rst.inc @@ -130,3 +134,5 @@ The actual default value of this option depends on other field options: .. include:: /reference/forms/types/options/mapped.rst.inc .. include:: /reference/forms/types/options/required.rst.inc + +.. include:: /reference/forms/types/options/row_attr.rst.inc diff --git a/reference/forms/types/currency.rst b/reference/forms/types/currency.rst index 15f94ec5b6b..83fdafa4e17 100644 --- a/reference/forms/types/currency.rst +++ b/reference/forms/types/currency.rst @@ -30,6 +30,7 @@ manually, but then you should just use the ``ChoiceType`` directly. | | | | | from the :doc:`FormType ` type | | | | +| | - `attr`_ | | | - `data`_ | | | - `disabled`_ | | | - `empty_data`_ | @@ -41,6 +42,7 @@ manually, but then you should just use the ``ChoiceType`` directly. | | - `label_format`_ | | | - `mapped`_ | | | - `required`_ | +| | - `row_attr`_ | +-------------+------------------------------------------------------------------------+ | Parent type | :doc:`ChoiceType ` | +-------------+------------------------------------------------------------------------+ @@ -88,6 +90,8 @@ These options inherit from the :doc:`ChoiceType ` These options inherit from the :doc:`FormType `: +.. include:: /reference/forms/types/options/attr.rst.inc + .. include:: /reference/forms/types/options/data.rst.inc .. include:: /reference/forms/types/options/disabled.rst.inc @@ -120,4 +124,6 @@ The actual default value of this option depends on other field options: .. include:: /reference/forms/types/options/required.rst.inc +.. include:: /reference/forms/types/options/row_attr.rst.inc + .. _`3-letter ISO 4217`: https://en.wikipedia.org/wiki/ISO_4217 diff --git a/reference/forms/types/date.rst b/reference/forms/types/date.rst index 6e2be4140e3..7ad378a1467 100644 --- a/reference/forms/types/date.rst +++ b/reference/forms/types/date.rst @@ -33,8 +33,9 @@ and can understand a number of different input formats via the `input`_ option. | | - `data_class`_ | | | - `error_bubbling`_ | +----------------------+-----------------------------------------------------------------------------+ -| Inherited | - `data`_ | -| options | - `disabled`_ | +| Inherited | - `attr`_ | +| options | - `data`_ | +| | - `disabled`_ | | | - `error_mapping`_ | | | - `help`_ | | | - `help_attr`_ | @@ -43,6 +44,7 @@ and can understand a number of different input formats via the `input`_ option. | | - `invalid_message`_ | | | - `invalid_message_parameters`_ | | | - `mapped`_ | +| | - `row_attr`_ | +----------------------+-----------------------------------------------------------------------------+ | Parent type | :doc:`FormType ` | +----------------------+-----------------------------------------------------------------------------+ @@ -218,6 +220,8 @@ Inherited Options These options inherit from the :doc:`FormType `: +.. include:: /reference/forms/types/options/attr.rst.inc + .. include:: /reference/forms/types/options/data.rst.inc .. include:: /reference/forms/types/options/disabled.rst.inc @@ -238,6 +242,8 @@ These options inherit from the :doc:`FormType `: .. include:: /reference/forms/types/options/mapped.rst.inc +.. include:: /reference/forms/types/options/row_attr.rst.inc + Field Variables --------------- diff --git a/reference/forms/types/dateinterval.rst b/reference/forms/types/dateinterval.rst index f824df14877..299a7832aa5 100644 --- a/reference/forms/types/dateinterval.rst +++ b/reference/forms/types/dateinterval.rst @@ -37,8 +37,9 @@ or an array (see `input`_). | | - `with_years`_ | | | - `years`_ | +----------------------+----------------------------------------------------------------------------------+ -| Inherited | - `data`_ | -| options | - `disabled`_ | +| Inherited | - `attr`_ | +| options | - `data`_ | +| | - `disabled`_ | | | - `help`_ | | | - `help_attr`_ | | | - `help_html`_ | @@ -46,6 +47,7 @@ or an array (see `input`_). | | - `invalid_message`_ | | | - `invalid_message_parameters`_ | | | - `mapped`_ | +| | - `row_attr`_ | +----------------------+----------------------------------------------------------------------------------+ | Parent type | :doc:`FormType ` | +----------------------+----------------------------------------------------------------------------------+ @@ -336,6 +338,8 @@ Inherited Options These options inherit from the :doc:`form ` type: +.. include:: /reference/forms/types/options/attr.rst.inc + .. include:: /reference/forms/types/options/data.rst.inc .. include:: /reference/forms/types/options/disabled.rst.inc @@ -354,6 +358,8 @@ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/mapped.rst.inc +.. include:: /reference/forms/types/options/row_attr.rst.inc + Field Variables --------------- diff --git a/reference/forms/types/datetime.rst b/reference/forms/types/datetime.rst index 99fb9aa1722..6adc3e733eb 100644 --- a/reference/forms/types/datetime.rst +++ b/reference/forms/types/datetime.rst @@ -43,8 +43,9 @@ the data can be a ``DateTime`` object, a string, a timestamp or an array. | | - `data_class`_ | | | - `error_bubbling`_ | +----------------------+-----------------------------------------------------------------------------+ -| Inherited | - `data`_ | -| options | - `disabled`_ | +| Inherited | - `attr`_ | +| options | - `data`_ | +| | - `disabled`_ | | | - `help`_ | | | - `help_attr`_ | | | - `help_html`_ | @@ -52,6 +53,7 @@ the data can be a ``DateTime`` object, a string, a timestamp or an array. | | - `invalid_message`_ | | | - `invalid_message_parameters`_ | | | - `mapped`_ | +| | - `row_attr`_ | +----------------------+-----------------------------------------------------------------------------+ | Parent type | :doc:`FormType ` | +----------------------+-----------------------------------------------------------------------------+ @@ -254,6 +256,8 @@ Inherited Options These options inherit from the :doc:`FormType `: +.. include:: /reference/forms/types/options/attr.rst.inc + .. include:: /reference/forms/types/options/data.rst.inc .. include:: /reference/forms/types/options/disabled.rst.inc @@ -272,6 +276,8 @@ These options inherit from the :doc:`FormType `: .. include:: /reference/forms/types/options/mapped.rst.inc +.. include:: /reference/forms/types/options/row_attr.rst.inc + Field Variables --------------- diff --git a/reference/forms/types/email.rst b/reference/forms/types/email.rst index f2e694857a8..74eeaa95272 100644 --- a/reference/forms/types/email.rst +++ b/reference/forms/types/email.rst @@ -10,8 +10,9 @@ The ``EmailType`` field is a text field that is rendered using the HTML5 +-------------+---------------------------------------------------------------------+ | Rendered as | ``input`` ``email`` field (a text box) | +-------------+---------------------------------------------------------------------+ -| Inherited | - `data`_ | -| options | - `disabled`_ | +| Inherited | - `attr`_ | +| options | - `data`_ | +| | - `disabled`_ | | | - `empty_data`_ | | | - `error_bubbling`_ | | | - `error_mapping`_ | @@ -23,6 +24,7 @@ The ``EmailType`` field is a text field that is rendered using the HTML5 | | - `label_format`_ | | | - `mapped`_ | | | - `required`_ | +| | - `row_attr`_ | | | - `trim`_ | +-------------+---------------------------------------------------------------------+ | Parent type | :doc:`TextType ` | @@ -37,6 +39,8 @@ Inherited Options These options inherit from the :doc:`FormType `: +.. include:: /reference/forms/types/options/attr.rst.inc + .. include:: /reference/forms/types/options/data.rst.inc .. include:: /reference/forms/types/options/disabled.rst.inc @@ -69,4 +73,6 @@ The default value is ``''`` (the empty string). .. include:: /reference/forms/types/options/required.rst.inc +.. include:: /reference/forms/types/options/row_attr.rst.inc + .. include:: /reference/forms/types/options/trim.rst.inc diff --git a/reference/forms/types/entity.rst b/reference/forms/types/entity.rst index 7415cfe5d48..4c0affceb0f 100644 --- a/reference/forms/types/entity.rst +++ b/reference/forms/types/entity.rst @@ -50,6 +50,7 @@ objects from the database. | | - `label_format`_ | | | - `mapped`_ | | | - `required`_ | +| | - `row_attr`_ | | | - `label_translation_parameters`_ | | | - `attr_translation_parameters`_ | | | - `help_translation_parameters`_ | @@ -362,6 +363,8 @@ The actual default value of this option depends on other field options: .. include:: /reference/forms/types/options/required.rst.inc +.. include:: /reference/forms/types/options/row_attr.rst.inc + .. include:: /reference/forms/types/options/label_translation_parameters.rst.inc .. include:: /reference/forms/types/options/attr_translation_parameters.rst.inc diff --git a/reference/forms/types/file.rst b/reference/forms/types/file.rst index 9c9c892a98c..4534c7f8b05 100644 --- a/reference/forms/types/file.rst +++ b/reference/forms/types/file.rst @@ -15,8 +15,9 @@ The ``FileType`` represents a file input in your form. | options | - `data_class`_ | | | - `empty_data`_ | +-------------+---------------------------------------------------------------------+ -| Inherited | - `disabled`_ | -| options | - `error_bubbling`_ | +| Inherited | - `attr`_ | +| options | - `disabled`_ | +| | - `error_bubbling`_ | | | - `error_mapping`_ | | | - `help`_ | | | - `help_attr`_ | @@ -26,6 +27,7 @@ The ``FileType`` represents a file input in your form. | | - `label_format`_ | | | - `mapped`_ | | | - `required`_ | +| | - `row_attr`_ | +-------------+---------------------------------------------------------------------+ | Parent type | :doc:`FormType ` | +-------------+---------------------------------------------------------------------+ @@ -123,6 +125,8 @@ Inherited Options These options inherit from the :doc:`FormType `: +.. include:: /reference/forms/types/options/attr.rst.inc + .. include:: /reference/forms/types/options/disabled.rst.inc .. include:: /reference/forms/types/options/error_bubbling.rst.inc @@ -145,6 +149,8 @@ These options inherit from the :doc:`FormType `: .. include:: /reference/forms/types/options/required.rst.inc +.. include:: /reference/forms/types/options/row_attr.rst.inc + Form Variables -------------- diff --git a/reference/forms/types/form.rst b/reference/forms/types/form.rst index 9d38ab840cc..4b833bcb178 100644 --- a/reference/forms/types/form.rst +++ b/reference/forms/types/form.rst @@ -42,6 +42,7 @@ on all types for which ``FormType`` is the parent. | | - `block_prefix`_ | | | - `disabled`_ | | | - `label`_ | +| | - `row_attr`_ | | | - `translation_domain`_ | | | - `label_translation_parameters`_ | | | - `attr_translation_parameters`_ | @@ -171,6 +172,8 @@ of the form type tree (i.e. it cannot be used as a form type on its own). .. include:: /reference/forms/types/options/label.rst.inc +.. include:: /reference/forms/types/options/row_attr.rst.inc + .. include:: /reference/forms/types/options/translation_domain.rst.inc .. include:: /reference/forms/types/options/label_translation_parameters.rst.inc diff --git a/reference/forms/types/hidden.rst b/reference/forms/types/hidden.rst index df3a370b7db..7728024fb9d 100644 --- a/reference/forms/types/hidden.rst +++ b/reference/forms/types/hidden.rst @@ -13,10 +13,12 @@ The hidden type represents a hidden input field. | options | - `error_bubbling`_ | | | - `required`_ | +-------------+----------------------------------------------------------------------+ -| Inherited | - `data`_ | -| options | - `error_mapping`_ | +| Inherited | - `attr`_ | +| options | - `data`_ | +| | - `error_mapping`_ | | | - `mapped`_ | | | - `property_path`_ | +| | - `row_attr`_ | +-------------+----------------------------------------------------------------------+ | Parent type | :doc:`FormType ` | +-------------+----------------------------------------------------------------------+ @@ -49,6 +51,8 @@ Inherited Options These options inherit from the :doc:`FormType `: +.. include:: /reference/forms/types/options/attr.rst.inc + .. include:: /reference/forms/types/options/data.rst.inc .. include:: /reference/forms/types/options/error_mapping.rst.inc @@ -56,3 +60,5 @@ These options inherit from the :doc:`FormType `: .. include:: /reference/forms/types/options/mapped.rst.inc .. include:: /reference/forms/types/options/property_path.rst.inc + +.. include:: /reference/forms/types/options/row_attr.rst.inc diff --git a/reference/forms/types/integer.rst b/reference/forms/types/integer.rst index 42d3ea9a4db..d2ba783a8b3 100644 --- a/reference/forms/types/integer.rst +++ b/reference/forms/types/integer.rst @@ -22,8 +22,9 @@ integers. By default, all non-integer values (e.g. 6.78) will round down | Overridden | - `compound`_ | | options | - `scale`_ | +-------------+-----------------------------------------------------------------------+ -| Inherited | - `data`_ | -| options | - `disabled`_ | +| Inherited | - `attr`_ | +| options | - `data`_ | +| | - `disabled`_ | | | - `empty_data`_ | | | - `error_bubbling`_ | | | - `error_mapping`_ | @@ -37,6 +38,7 @@ integers. By default, all non-integer values (e.g. 6.78) will round down | | - `label_format`_ | | | - `mapped`_ | | | - `required`_ | +| | - `row_attr`_ | +-------------+-----------------------------------------------------------------------+ | Parent type | :doc:`FormType ` | +-------------+-----------------------------------------------------------------------+ @@ -104,6 +106,8 @@ Inherited Options These options inherit from the :doc:`FormType `: +.. include:: /reference/forms/types/options/attr.rst.inc + .. include:: /reference/forms/types/options/data.rst.inc .. include:: /reference/forms/types/options/disabled.rst.inc @@ -139,3 +143,5 @@ The default value is ``''`` (the empty string). .. include:: /reference/forms/types/options/mapped.rst.inc .. include:: /reference/forms/types/options/required.rst.inc + +.. include:: /reference/forms/types/options/row_attr.rst.inc diff --git a/reference/forms/types/language.rst b/reference/forms/types/language.rst index 013dbbb7430..7aee017fcce 100644 --- a/reference/forms/types/language.rst +++ b/reference/forms/types/language.rst @@ -40,6 +40,7 @@ manually, but then you should just use the ``ChoiceType`` directly. | | | | | from the :doc:`FormType ` | | | | +| | - `attr`_ | | | - `data`_ | | | - `disabled`_ | | | - `empty_data`_ | @@ -51,6 +52,7 @@ manually, but then you should just use the ``ChoiceType`` directly. | | - `label_format`_ | | | - `mapped`_ | | | - `required`_ | +| | - `row_attr`_ | +-------------+------------------------------------------------------------------------+ | Parent type | :doc:`ChoiceType ` | +-------------+------------------------------------------------------------------------+ @@ -101,6 +103,8 @@ These options inherit from the :doc:`ChoiceType ` These options inherit from the :doc:`FormType `: +.. include:: /reference/forms/types/options/attr.rst.inc + .. include:: /reference/forms/types/options/data.rst.inc .. include:: /reference/forms/types/options/disabled.rst.inc @@ -133,4 +137,6 @@ The actual default value of this option depends on other field options: .. include:: /reference/forms/types/options/required.rst.inc +.. include:: /reference/forms/types/options/row_attr.rst.inc + .. _`International Components for Unicode`: http://site.icu-project.org diff --git a/reference/forms/types/locale.rst b/reference/forms/types/locale.rst index bfe19e9e2c8..6afaddd6250 100644 --- a/reference/forms/types/locale.rst +++ b/reference/forms/types/locale.rst @@ -41,6 +41,7 @@ manually, but then you should just use the ``ChoiceType`` directly. | | | | | from the :doc:`FormType ` | | | | +| | - `attr`_ | | | - `data`_ | | | - `disabled`_ | | | - `empty_data`_ | @@ -52,6 +53,7 @@ manually, but then you should just use the ``ChoiceType`` directly. | | - `label_format`_ | | | - `mapped`_ | | | - `required`_ | +| | - `row_attr`_ | +-------------+------------------------------------------------------------------------+ | Parent type | :doc:`ChoiceType ` | +-------------+------------------------------------------------------------------------+ @@ -102,6 +104,8 @@ These options inherit from the :doc:`ChoiceType ` These options inherit from the :doc:`FormType `: +.. include:: /reference/forms/types/options/attr.rst.inc + .. include:: /reference/forms/types/options/data.rst.inc .. include:: /reference/forms/types/options/disabled.rst.inc @@ -134,5 +138,7 @@ The actual default value of this option depends on other field options: .. include:: /reference/forms/types/options/required.rst.inc +.. include:: /reference/forms/types/options/row_attr.rst.inc + .. _`ISO 639-1`: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes .. _`ISO 3166-1 alpha-2`: https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes diff --git a/reference/forms/types/money.rst b/reference/forms/types/money.rst index a02b68b95a7..27c689471b8 100644 --- a/reference/forms/types/money.rst +++ b/reference/forms/types/money.rst @@ -23,8 +23,9 @@ how the input and output of the data is handled. | Overridden | - `compound`_ | | options | | +-------------+---------------------------------------------------------------------+ -| Inherited | - `data`_ | -| options | - `disabled`_ | +| Inherited | - `attr`_ | +| options | - `data`_ | +| | - `disabled`_ | | | - `empty_data`_ | | | - `error_bubbling`_ | | | - `error_mapping`_ | @@ -38,6 +39,7 @@ how the input and output of the data is handled. | | - `label_format`_ | | | - `mapped`_ | | | - `required`_ | +| | - `row_attr`_ | +-------------+---------------------------------------------------------------------+ | Parent type | :doc:`FormType ` | +-------------+---------------------------------------------------------------------+ @@ -107,6 +109,8 @@ Inherited Options These options inherit from the :doc:`FormType `: +.. include:: /reference/forms/types/options/attr.rst.inc + .. include:: /reference/forms/types/options/data.rst.inc .. include:: /reference/forms/types/options/disabled.rst.inc @@ -143,6 +147,8 @@ The default value is ``''`` (the empty string). .. include:: /reference/forms/types/options/required.rst.inc +.. include:: /reference/forms/types/options/row_attr.rst.inc + Form Variables -------------- diff --git a/reference/forms/types/number.rst b/reference/forms/types/number.rst index c5db2c7b092..6e9215c276a 100644 --- a/reference/forms/types/number.rst +++ b/reference/forms/types/number.rst @@ -20,8 +20,9 @@ that you want to use for your number. | Overridden | - `compound`_ | | options | | +-------------+----------------------------------------------------------------------+ -| Inherited | - `data`_ | -| options | - `disabled`_ | +| Inherited | - `attr`_ | +| options | - `data`_ | +| | - `disabled`_ | | | - `empty_data`_ | | | - `error_bubbling`_ | | | - `error_mapping`_ | @@ -35,6 +36,7 @@ that you want to use for your number. | | - `label_format`_ | | | - `mapped`_ | | | - `required`_ | +| | - `row_attr`_ | +-------------+----------------------------------------------------------------------+ | Parent type | :doc:`FormType ` | +-------------+----------------------------------------------------------------------+ @@ -97,6 +99,8 @@ Inherited Options These options inherit from the :doc:`FormType `: +.. include:: /reference/forms/types/options/attr.rst.inc + .. include:: /reference/forms/types/options/data.rst.inc .. include:: /reference/forms/types/options/disabled.rst.inc @@ -132,3 +136,5 @@ The default value is ``''`` (the empty string). .. include:: /reference/forms/types/options/mapped.rst.inc .. include:: /reference/forms/types/options/required.rst.inc + +.. include:: /reference/forms/types/options/row_attr.rst.inc diff --git a/reference/forms/types/options/attr.rst.inc b/reference/forms/types/options/attr.rst.inc index d7ecc7e46dd..3262408e739 100644 --- a/reference/forms/types/options/attr.rst.inc +++ b/reference/forms/types/options/attr.rst.inc @@ -10,3 +10,8 @@ as keys. This can be useful when you need to set a custom class for some widget: $builder->add('body', TextareaType::class, [ 'attr' => ['class' => 'tinymce'], ]); + +.. seealso:: + + Use the ``row_attr`` option if you want to add these attributes to the + the :ref:`form type row ` element. diff --git a/reference/forms/types/options/row_attr.rst.inc b/reference/forms/types/options/row_attr.rst.inc new file mode 100644 index 00000000000..4cb9775b5e5 --- /dev/null +++ b/reference/forms/types/options/row_attr.rst.inc @@ -0,0 +1,20 @@ +row_attr +~~~~~~~~ + +**type**: ``array`` **default**: ``[]`` + +An associative array of the HTML attributes added to the element which is used +to render the :ref:`form type row `:: + + $builder->add('body', TextareaType::class, [ + 'row_attr' => ['class' => 'text-editor', 'id' => '...'], + ]); + +.. seealso:: + + Use the ``attr`` option if you want to add these attributes to the + the :ref:`form type widget ` element. + +.. versionadded:: 4.3 + + The ``row_attr`` option was introduced in Symfony 4.3. diff --git a/reference/forms/types/password.rst b/reference/forms/types/password.rst index 75f2a595701..b6617dfe1a3 100644 --- a/reference/forms/types/password.rst +++ b/reference/forms/types/password.rst @@ -14,8 +14,9 @@ The ``PasswordType`` field renders an input password text box. | Overridden | - `trim`_ | | options | | +-------------+------------------------------------------------------------------------+ -| Inherited | - `disabled`_ | -| options | - `empty_data`_ | +| Inherited | - `attr`_ | +| options | - `disabled`_ | +| | - `empty_data`_ | | | - `error_bubbling`_ | | | - `error_mapping`_ | | | - `help`_ | @@ -26,6 +27,7 @@ The ``PasswordType`` field renders an input password text box. | | - `label_format`_ | | | - `mapped`_ | | | - `required`_ | +| | - `row_attr`_ | +-------------+------------------------------------------------------------------------+ | Parent type | :doc:`TextType ` | +-------------+------------------------------------------------------------------------+ @@ -67,6 +69,8 @@ Inherited Options These options inherit from the :doc:`FormType `: +.. include:: /reference/forms/types/options/attr.rst.inc + .. include:: /reference/forms/types/options/disabled.rst.inc .. include:: /reference/forms/types/options/empty_data.rst.inc @@ -96,3 +100,5 @@ The default value is ``''`` (the empty string). .. include:: /reference/forms/types/options/mapped.rst.inc .. include:: /reference/forms/types/options/required.rst.inc + +.. include:: /reference/forms/types/options/row_attr.rst.inc diff --git a/reference/forms/types/percent.rst b/reference/forms/types/percent.rst index 87ad13ac4e9..b6a516fffc0 100644 --- a/reference/forms/types/percent.rst +++ b/reference/forms/types/percent.rst @@ -22,8 +22,9 @@ the input. | Overridden | - `compound`_ | | options | | +-------------+-----------------------------------------------------------------------+ -| Inherited | - `data`_ | -| options | - `disabled`_ | +| Inherited | - `attr`_ | +| options | - `data`_ | +| | - `disabled`_ | | | - `empty_data`_ | | | - `error_bubbling`_ | | | - `error_mapping`_ | @@ -37,6 +38,7 @@ the input. | | - `label_format`_ | | | - `mapped`_ | | | - `required`_ | +| | - `row_attr`_ | +-------------+-----------------------------------------------------------------------+ | Parent type | :doc:`FormType ` | +-------------+-----------------------------------------------------------------------+ @@ -100,6 +102,8 @@ Inherited Options These options inherit from the :doc:`FormType `: +.. include:: /reference/forms/types/options/attr.rst.inc + .. include:: /reference/forms/types/options/data.rst.inc .. include:: /reference/forms/types/options/disabled.rst.inc @@ -135,3 +139,5 @@ The default value is ``''`` (the empty string). .. include:: /reference/forms/types/options/mapped.rst.inc .. include:: /reference/forms/types/options/required.rst.inc + +.. include:: /reference/forms/types/options/row_attr.rst.inc diff --git a/reference/forms/types/radio.rst b/reference/forms/types/radio.rst index 868168be35f..ae0d58d2fe4 100644 --- a/reference/forms/types/radio.rst +++ b/reference/forms/types/radio.rst @@ -22,6 +22,7 @@ If you want to have a boolean field, use :doc:`CheckboxType `: | | | | +| | - `attr`_ | | | - `data`_ | | | - `disabled`_ | | | - `empty_data`_ | @@ -35,6 +36,7 @@ If you want to have a boolean field, use :doc:`CheckboxType ` | +-------------+---------------------------------------------------------------------+ @@ -52,6 +54,8 @@ These options inherit from the :doc:`CheckboxType `: +.. include:: /reference/forms/types/options/attr.rst.inc + .. include:: /reference/forms/types/options/data.rst.inc .. include:: /reference/forms/types/options/disabled.rst.inc @@ -78,6 +82,8 @@ These options inherit from the :doc:`FormType `: .. include:: /reference/forms/types/options/required.rst.inc +.. include:: /reference/forms/types/options/row_attr.rst.inc + Form Variables -------------- diff --git a/reference/forms/types/range.rst b/reference/forms/types/range.rst index 3b23aa0e0ff..e328a1bbe97 100644 --- a/reference/forms/types/range.rst +++ b/reference/forms/types/range.rst @@ -23,6 +23,7 @@ The ``RangeType`` field is a slider that is rendered using the HTML5 | | - `label_attr`_ | | | - `mapped`_ | | | - `required`_ | +| | - `row_attr`_ | | | - `trim`_ | +-------------+---------------------------------------------------------------------+ | Parent type | :doc:`TextType ` | @@ -84,4 +85,6 @@ The default value is ``''`` (the empty string). .. include:: /reference/forms/types/options/required.rst.inc +.. include:: /reference/forms/types/options/row_attr.rst.inc + .. include:: /reference/forms/types/options/trim.rst.inc diff --git a/reference/forms/types/repeated.rst b/reference/forms/types/repeated.rst index 5a334610a0c..4c47d244a32 100644 --- a/reference/forms/types/repeated.rst +++ b/reference/forms/types/repeated.rst @@ -22,14 +22,16 @@ accuracy. | Overridden | - `error_bubbling`_ | | options | | +-------------+------------------------------------------------------------------------+ -| Inherited | - `data`_ | -| options | - `error_mapping`_ | +| Inherited | - `attr`_ | +| options | - `data`_ | +| | - `error_mapping`_ | | | - `help`_ | | | - `help_attr`_ | | | - `help_html`_ | | | - `invalid_message`_ | | | - `invalid_message_parameters`_ | | | - `mapped`_ | +| | - `row_attr`_ | +-------------+------------------------------------------------------------------------+ | Parent type | :doc:`FormType ` | +-------------+------------------------------------------------------------------------+ @@ -182,6 +184,8 @@ Inherited Options These options inherit from the :doc:`FormType `: +.. include:: /reference/forms/types/options/attr.rst.inc + .. include:: /reference/forms/types/options/data.rst.inc .. include:: /reference/forms/types/options/error_mapping.rst.inc @@ -197,3 +201,5 @@ These options inherit from the :doc:`FormType `: .. include:: /reference/forms/types/options/invalid_message_parameters.rst.inc .. include:: /reference/forms/types/options/mapped.rst.inc + +.. include:: /reference/forms/types/options/row_attr.rst.inc diff --git a/reference/forms/types/reset.rst b/reference/forms/types/reset.rst index a9639e03bc7..7a444a6dd9d 100644 --- a/reference/forms/types/reset.rst +++ b/reference/forms/types/reset.rst @@ -14,6 +14,7 @@ A button that resets all fields to their original values. | | - `disabled`_ | | | - `label`_ | | | - `label_translation_parameters`_ | +| | - `row_attr`_ | | | - `translation_domain`_ | +----------------------+---------------------------------------------------------------------+ | Parent type | :doc:`ButtonType ` | @@ -81,3 +82,5 @@ option of its parents, so buttons can reuse and/or override any of the parent placeholders. .. include:: /reference/forms/types/options/attr_translation_parameters.rst.inc + +.. include:: /reference/forms/types/options/row_attr.rst.inc diff --git a/reference/forms/types/search.rst b/reference/forms/types/search.rst index 378c0dddd99..e0f8233aa5b 100644 --- a/reference/forms/types/search.rst +++ b/reference/forms/types/search.rst @@ -12,8 +12,9 @@ Read about the input search field at `DiveIntoHTML5.info`_ +-------------+----------------------------------------------------------------------+ | Rendered as | ``input search`` field | +-------------+----------------------------------------------------------------------+ -| Inherited | - `disabled`_ | -| options | - `empty_data`_ | +| Inherited | - `attr`_ | +| options | - `disabled`_ | +| | - `empty_data`_ | | | - `error_bubbling`_ | | | - `error_mapping`_ | | | - `help`_ | @@ -24,6 +25,7 @@ Read about the input search field at `DiveIntoHTML5.info`_ | | - `label_format`_ | | | - `mapped`_ | | | - `required`_ | +| | - `row_attr`_ | | | - `trim`_ | +-------------+----------------------------------------------------------------------+ | Parent type | :doc:`TextType ` | @@ -38,6 +40,8 @@ Inherited Options These options inherit from the :doc:`FormType `: +.. include:: /reference/forms/types/options/attr.rst.inc + .. include:: /reference/forms/types/options/disabled.rst.inc .. include:: /reference/forms/types/options/empty_data.rst.inc @@ -68,6 +72,8 @@ The default value is ``''`` (the empty string). .. include:: /reference/forms/types/options/required.rst.inc +.. include:: /reference/forms/types/options/row_attr.rst.inc + .. include:: /reference/forms/types/options/trim.rst.inc .. _`DiveIntoHTML5.info`: http://diveintohtml5.info/forms.html#type-search diff --git a/reference/forms/types/submit.rst b/reference/forms/types/submit.rst index 7a0672ea6c2..d3897a84f9c 100644 --- a/reference/forms/types/submit.rst +++ b/reference/forms/types/submit.rst @@ -15,6 +15,7 @@ A submit button. | | - `label`_ | | | - `label_format`_ | | | - `label_translation_parameters`_ | +| | - `row_attr`_ | | | - `translation_domain`_ | | | - `validation_groups`_ | +----------------------+----------------------------------------------------------------------+ @@ -95,6 +96,8 @@ placeholders. .. include:: /reference/forms/types/options/attr_translation_parameters.rst.inc +.. include:: /reference/forms/types/options/row_attr.rst.inc + validation_groups ~~~~~~~~~~~~~~~~~ diff --git a/reference/forms/types/tel.rst b/reference/forms/types/tel.rst index ca5920ea3c6..f6c19391ada 100644 --- a/reference/forms/types/tel.rst +++ b/reference/forms/types/tel.rst @@ -16,8 +16,9 @@ to input phone numbers. +-------------+---------------------------------------------------------------------+ | Rendered as | ``input`` ``tel`` field (a text box) | +-------------+---------------------------------------------------------------------+ -| Inherited | - `data`_ | -| options | - `disabled`_ | +| Inherited | - `attr`_ | +| options | - `data`_ | +| | - `disabled`_ | | | - `empty_data`_ | | | - `error_bubbling`_ | | | - `error_mapping`_ | @@ -29,6 +30,7 @@ to input phone numbers. | | - `label_format`_ | | | - `mapped`_ | | | - `required`_ | +| | - `row_attr`_ | | | - `trim`_ | +-------------+---------------------------------------------------------------------+ | Parent type | :doc:`TextType ` | @@ -43,6 +45,8 @@ Inherited Options These options inherit from the :doc:`FormType `: +.. include:: /reference/forms/types/options/attr.rst.inc + .. include:: /reference/forms/types/options/data.rst.inc .. include:: /reference/forms/types/options/disabled.rst.inc @@ -75,4 +79,6 @@ The default value is ``''`` (the empty string). .. include:: /reference/forms/types/options/required.rst.inc +.. include:: /reference/forms/types/options/row_attr.rst.inc + .. include:: /reference/forms/types/options/trim.rst.inc diff --git a/reference/forms/types/text.rst b/reference/forms/types/text.rst index 7dc5ddf5554..a12af8e778f 100644 --- a/reference/forms/types/text.rst +++ b/reference/forms/types/text.rst @@ -23,6 +23,7 @@ The TextType field represents the most basic input text field. | | - `label_format`_ | | | - `mapped`_ | | | - `required`_ | +| | - `row_attr`_ | | | - `trim`_ | +-------------+--------------------------------------------------------------------+ | Overridden | - `compound`_ | @@ -76,6 +77,8 @@ an empty string, explicitly set the ``empty_data`` option to an empty string. .. include:: /reference/forms/types/options/required.rst.inc +.. include:: /reference/forms/types/options/row_attr.rst.inc + .. include:: /reference/forms/types/options/trim.rst.inc Overridden Options diff --git a/reference/forms/types/textarea.rst b/reference/forms/types/textarea.rst index 2e79fbdbc0d..2e85e19e0cb 100644 --- a/reference/forms/types/textarea.rst +++ b/reference/forms/types/textarea.rst @@ -23,6 +23,7 @@ Renders a ``textarea`` HTML element. | | - `label_format`_ | | | - `mapped`_ | | | - `required`_ | +| | - `row_attr`_ | | | - `trim`_ | +-------------+------------------------------------------------------------------------+ | Parent type | :doc:`TextType ` | @@ -77,6 +78,8 @@ The default value is ``''`` (the empty string). .. include:: /reference/forms/types/options/required.rst.inc +.. include:: /reference/forms/types/options/row_attr.rst.inc + .. include:: /reference/forms/types/options/trim.rst.inc .. _`its documentation`: https://symfony.com/doc/current/bundles/FOSCKEditorBundle/index.html diff --git a/reference/forms/types/time.rst b/reference/forms/types/time.rst index 0636f34fb5b..09d368e4ee3 100644 --- a/reference/forms/types/time.rst +++ b/reference/forms/types/time.rst @@ -34,8 +34,9 @@ stored as a ``DateTime`` object, a string, a timestamp or an array. | | - `data_class`_ | | | - `error_bubbling`_ | +----------------------+-----------------------------------------------------------------------------+ -| Inherited | - `data`_ | -| Options | - `disabled`_ | +| Inherited | - `attr`_ | +| options | - `data`_ | +| | - `disabled`_ | | | - `error_mapping`_ | | | - `help`_ | | | - `help_attr`_ | @@ -44,6 +45,7 @@ stored as a ``DateTime`` object, a string, a timestamp or an array. | | - `invalid_message`_ | | | - `invalid_message_parameters`_ | | | - `mapped`_ | +| | - `row_attr`_ | +----------------------+-----------------------------------------------------------------------------+ | Parent type | FormType | +----------------------+-----------------------------------------------------------------------------+ @@ -204,6 +206,8 @@ Inherited Options These options inherit from the :doc:`FormType `: +.. include:: /reference/forms/types/options/attr.rst.inc + .. include:: /reference/forms/types/options/data.rst.inc .. include:: /reference/forms/types/options/disabled.rst.inc @@ -224,6 +228,8 @@ These options inherit from the :doc:`FormType `: .. include:: /reference/forms/types/options/mapped.rst.inc +.. include:: /reference/forms/types/options/row_attr.rst.inc + Form Variables -------------- diff --git a/reference/forms/types/timezone.rst b/reference/forms/types/timezone.rst index f6d9bd3653d..64c2e30a0fa 100644 --- a/reference/forms/types/timezone.rst +++ b/reference/forms/types/timezone.rst @@ -35,6 +35,7 @@ manually, but then you should just use the ``ChoiceType`` directly. | | | | | from the :doc:`FormType ` | | | | +| | - `attr`_ | | | - `data`_ | | | - `disabled`_ | | | - `empty_data`_ | @@ -48,6 +49,7 @@ manually, but then you should just use the ``ChoiceType`` directly. | | - `label_format`_ | | | - `mapped`_ | | | - `required`_ | +| | - `row_attr`_ | +-------------+------------------------------------------------------------------------+ | Parent type | :doc:`ChoiceType ` | +-------------+------------------------------------------------------------------------+ @@ -143,6 +145,8 @@ These options inherit from the :doc:`ChoiceType ` These options inherit from the :doc:`FormType `: +.. include:: /reference/forms/types/options/attr.rst.inc + .. include:: /reference/forms/types/options/data.rst.inc .. include:: /reference/forms/types/options/disabled.rst.inc @@ -179,4 +183,6 @@ The actual default value of this option depends on other field options: .. include:: /reference/forms/types/options/required.rst.inc +.. include:: /reference/forms/types/options/row_attr.rst.inc + .. _`ICU Project`: http://site.icu-project.org/ diff --git a/reference/forms/types/url.rst b/reference/forms/types/url.rst index d9246467633..781ccea36dc 100644 --- a/reference/forms/types/url.rst +++ b/reference/forms/types/url.rst @@ -13,8 +13,9 @@ have a protocol. +-------------+-------------------------------------------------------------------+ | Options | - `default_protocol`_ | +-------------+-------------------------------------------------------------------+ -| Inherited | - `data`_ | -| options | - `disabled`_ | +| Inherited | - `attr`_ | +| options | - `data`_ | +| | - `disabled`_ | | | - `empty_data`_ | | | - `error_bubbling`_ | | | - `error_mapping`_ | @@ -26,6 +27,7 @@ have a protocol. | | - `label_format`_ | | | - `mapped`_ | | | - `required`_ | +| | - `row_attr`_ | | | - `trim`_ | +-------------+-------------------------------------------------------------------+ | Parent type | :doc:`TextType ` | @@ -52,6 +54,8 @@ Inherited Options These options inherit from the :doc:`FormType `: +.. include:: /reference/forms/types/options/attr.rst.inc + .. include:: /reference/forms/types/options/data.rst.inc .. include:: /reference/forms/types/options/disabled.rst.inc @@ -84,4 +88,6 @@ The default value is ``''`` (the empty string). .. include:: /reference/forms/types/options/required.rst.inc +.. include:: /reference/forms/types/options/row_attr.rst.inc + .. include:: /reference/forms/types/options/trim.rst.inc