Skip to content

Add help option to FormType #9361

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions form/form_customization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ You can also render each of the three parts of the field individually:
{{ form_label(form.age) }}
{{ form_errors(form.age) }}
{{ form_widget(form.age) }}
{{ form_help(form.age) }}
</div>

.. code-block:: php
Expand Down Expand Up @@ -796,6 +797,7 @@ You can also override the markup for an entire field row using the same method:
{{ form_label(form) }}
{{ form_errors(form) }}
{{ form_widget(form) }}
{{ form_help(form) }}
</div>
{% endblock %}

Expand Down Expand Up @@ -1024,6 +1026,7 @@ class to the ``div`` element around each row:
{{ form_label(form) }}
{{ form_errors(form) }}
{{ form_widget(form) }}
{{ form_help(form) }}
</div>
{% endblock form_row %}

Expand Down
3 changes: 3 additions & 0 deletions form/form_themes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ do this, create a new template file that will store the new markup:
{{ form_label(form) }}
{{ form_errors(form) }}
{{ form_widget(form) }}
{{ form_help(form) }}
</div>
{% endspaceless %}
{% endblock form_row %}
Expand Down Expand Up @@ -135,6 +136,8 @@ are 4 possible *parts* of a form that can be rendered:
+-------------+----------------------------+---------------------------------------------------------+
| ``errors`` | (e.g. ``form_errors()``) | renders the field's errors |
+-------------+----------------------------+---------------------------------------------------------+
| ``help`` | (e.g. ``form_help()``) | renders the field's help |
+-------------+----------------------------+---------------------------------------------------------+
| ``row`` | (e.g. ``form_row()``) | renders the field's entire row (label, widget & errors) |
+-------------+----------------------------+---------------------------------------------------------+

Expand Down
2 changes: 2 additions & 0 deletions form/rendering.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,14 @@ used the ``form_row()`` helper:
{{ form_label(form.task) }}
{{ form_errors(form.task) }}
{{ form_widget(form.task) }}
{{ form_help(form.task) }}
</div>

<div>
{{ form_label(form.dueDate) }}
{{ form_errors(form.dueDate) }}
{{ form_widget(form.dueDate) }}
{{ form_help(form.dueDate) }}
</div>

<div>
Expand Down
3 changes: 3 additions & 0 deletions reference/forms/types/birthday.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ option defaults to 120 years ago to the current year.
| | - `invalid_message`_ |
| | - `invalid_message_parameters`_ |
| | - `mapped`_ |
| | - `help`_ |
Copy link
Member

@xabbuh xabbuh Apr 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be between disabled and invalid_message IMO to keep options in alphabetical order

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same in the other files

+----------------------+-------------------------------------------------------------------------------+
| Parent type | :doc:`DateType </reference/forms/types/date>` |
+----------------------+-------------------------------------------------------------------------------+
Expand Down Expand Up @@ -115,3 +116,5 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:
.. include:: /reference/forms/types/options/invalid_message_parameters.rst.inc

.. include:: /reference/forms/types/options/mapped.rst.inc

.. include:: /reference/forms/types/options/help.rst.inc
3 changes: 3 additions & 0 deletions reference/forms/types/checkbox.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ true, if the box is unchecked, the value will be set to false.
| | - `label_format`_ |
| | - `mapped`_ |
| | - `required`_ |
| | - `help`_ |
+-------------+------------------------------------------------------------------------+
| Parent type | :doc:`FormType </reference/forms/types/form>` |
+-------------+------------------------------------------------------------------------+
Expand Down Expand Up @@ -79,6 +80,8 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:

.. include:: /reference/forms/types/options/required.rst.inc

.. include:: /reference/forms/types/options/help.rst.inc

Form Variables
--------------

Expand Down
3 changes: 3 additions & 0 deletions reference/forms/types/choice.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ To use this field, you must specify *either* ``choices`` or ``choice_loader`` op
| | - `mapped`_ |
| | - `required`_ |
| | - `translation_domain`_ |
| | - `help`_ |
+-------------+------------------------------------------------------------------------------+
| Parent type | :doc:`FormType </reference/forms/types/form>` |
+-------------+------------------------------------------------------------------------------+
Expand Down Expand Up @@ -278,6 +279,8 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:

.. include:: /reference/forms/types/options/choice_type_translation_domain.rst.inc

.. include:: /reference/forms/types/options/help.rst.inc

Field Variables
---------------

Expand Down
3 changes: 3 additions & 0 deletions reference/forms/types/color.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ element.
| | - `mapped`_ |
| | - `required`_ |
| | - `trim`_ |
| | - `help`_ |
+-------------+---------------------------------------------------------------------+
| Parent type | :doc:`TextType </reference/forms/types/text>` |
+-------------+---------------------------------------------------------------------+
Expand Down Expand Up @@ -66,3 +67,5 @@ The default value is ``''`` (the empty string).
.. include:: /reference/forms/types/options/required.rst.inc

.. include:: /reference/forms/types/options/trim.rst.inc

.. include:: /reference/forms/types/options/help.rst.inc
3 changes: 3 additions & 0 deletions reference/forms/types/country.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ the option manually, but then you should just use the ``ChoiceType`` directly.
| | - `label_format`_ |
| | - `mapped`_ |
| | - `required`_ |
| | - `help`_ |
+-------------+-----------------------------------------------------------------------+
| Parent type | :doc:`ChoiceType </reference/forms/types/choice>` |
+-------------+-----------------------------------------------------------------------+
Expand Down Expand Up @@ -109,3 +110,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/help.rst.inc
3 changes: 3 additions & 0 deletions reference/forms/types/currency.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ manually, but then you should just use the ``ChoiceType`` directly.
| | - `label_format`_ |
| | - `mapped`_ |
| | - `required`_ |
| | - `help`_ |
+-------------+------------------------------------------------------------------------+
| Parent type | :doc:`ChoiceType </reference/forms/types/choice>` |
+-------------+------------------------------------------------------------------------+
Expand Down Expand Up @@ -99,4 +100,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/help.rst.inc

.. _`3-letter ISO 4217`: https://en.wikipedia.org/wiki/ISO_4217
3 changes: 3 additions & 0 deletions reference/forms/types/date.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ and can understand a number of different input formats via the `input`_ option.
| | - `invalid_message`_ |
| | - `invalid_message_parameters`_ |
| | - `mapped`_ |
| | - `help`_ |
+----------------------+-----------------------------------------------------------------------------+
| Parent type | :doc:`FormType </reference/forms/types/form>` |
+----------------------+-----------------------------------------------------------------------------+
Expand Down Expand Up @@ -214,6 +215,8 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:

.. include:: /reference/forms/types/options/mapped.rst.inc

.. include:: /reference/forms/types/options/help.rst.inc

Field Variables
---------------

Expand Down
3 changes: 3 additions & 0 deletions reference/forms/types/dateinterval.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ or an array (see `input`_).
| | - `invalid_message`_ |
| | - `invalid_message_parameters`_ |
| | - `mapped`_ |
| | - `help`_ |
+----------------------+----------------------------------------------------------------------------------+
| Parent type | :doc:`FormType </reference/forms/types/form>` |
+----------------------+----------------------------------------------------------------------------------+
Expand Down Expand Up @@ -315,6 +316,8 @@ These options inherit from the :doc:`form </reference/forms/types/form>` type:

.. include:: /reference/forms/types/options/mapped.rst.inc

.. include:: /reference/forms/types/options/help.rst.inc

Field Variables
---------------

Expand Down
3 changes: 3 additions & 0 deletions reference/forms/types/datetime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ the data can be a ``DateTime`` object, a string, a timestamp or an array.
| | - `invalid_message`_ |
| | - `invalid_message_parameters`_ |
| | - `mapped`_ |
| | - `help`_ |
+----------------------+-----------------------------------------------------------------------------+
| Parent type | :doc:`FormType </reference/forms/types/form>` |
+----------------------+-----------------------------------------------------------------------------+
Expand Down Expand Up @@ -202,6 +203,8 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:

.. include:: /reference/forms/types/options/mapped.rst.inc

.. include:: /reference/forms/types/options/help.rst.inc

Field Variables
---------------

Expand Down
3 changes: 3 additions & 0 deletions reference/forms/types/email.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ The ``EmailType`` field is a text field that is rendered using the HTML5
| | - `mapped`_ |
| | - `required`_ |
| | - `trim`_ |
| | - `help`_ |
+-------------+---------------------------------------------------------------------+
| Parent type | :doc:`TextType </reference/forms/types/text>` |
+-------------+---------------------------------------------------------------------+
Expand Down Expand Up @@ -59,3 +60,5 @@ The default value is ``''`` (the empty string).
.. include:: /reference/forms/types/options/required.rst.inc

.. include:: /reference/forms/types/options/trim.rst.inc

.. include:: /reference/forms/types/options/help.rst.inc
3 changes: 3 additions & 0 deletions reference/forms/types/entity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ objects from the database.
| | - `label_format`_ |
| | - `mapped`_ |
| | - `required`_ |
| | - `help`_ |
+-------------+------------------------------------------------------------------+
| Parent type | :doc:`ChoiceType </reference/forms/types/choice>` |
+-------------+------------------------------------------------------------------+
Expand Down Expand Up @@ -312,3 +313,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/help.rst.inc
3 changes: 3 additions & 0 deletions reference/forms/types/file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ The ``FileType`` represents a file input in your form.
| | - `label_format`_ |
| | - `mapped`_ |
| | - `required`_ |
| | - `help`_ |
+-------------+---------------------------------------------------------------------+
| Parent type | :doc:`FormType </reference/forms/types/form>` |
+-------------+---------------------------------------------------------------------+
Expand Down Expand Up @@ -134,6 +135,8 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:

.. include:: /reference/forms/types/options/required.rst.inc

.. include:: /reference/forms/types/options/help.rst.inc

Form Variables
--------------

Expand Down
3 changes: 3 additions & 0 deletions reference/forms/types/form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ on all types for which ``FormType`` is the parent.
| | - `property_path`_ |
| | - `required`_ |
| | - `trim`_ |
| | - `help`_ |
+-----------+--------------------------------------------------------------------+
| Inherited | - `attr`_ |
| options | - `auto_initialize`_ |
Expand Down Expand Up @@ -128,6 +129,8 @@ The actual default value of this option depends on other field options:

.. include:: /reference/forms/types/options/trim.rst.inc

.. include:: /reference/forms/types/options/help.rst.inc

Inherited Options
-----------------

Expand Down
3 changes: 3 additions & 0 deletions reference/forms/types/integer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ integers. By default, all non-integer values (e.g. 6.78) will round down
| | - `label_format`_ |
| | - `mapped`_ |
| | - `required`_ |
| | - `help`_ |
+-------------+-----------------------------------------------------------------------+
| Parent type | :doc:`FormType </reference/forms/types/form>` |
+-------------+-----------------------------------------------------------------------+
Expand Down Expand Up @@ -116,3 +117,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/help.rst.inc
3 changes: 3 additions & 0 deletions reference/forms/types/language.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ manually, but then you should just use the ``ChoiceType`` directly.
| | - `label_format`_ |
| | - `mapped`_ |
| | - `required`_ |
| | - `help`_ |
+-------------+------------------------------------------------------------------------+
| Parent type | :doc:`ChoiceType </reference/forms/types/choice>` |
+-------------+------------------------------------------------------------------------+
Expand Down Expand Up @@ -112,4 +113,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/help.rst.inc

.. _`International Components for Unicode`: http://site.icu-project.org
3 changes: 3 additions & 0 deletions reference/forms/types/locale.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ manually, but then you should just use the ``ChoiceType`` directly.
| | - `label_format`_ |
| | - `mapped`_ |
| | - `required`_ |
| | - `help`_ |
+-------------+------------------------------------------------------------------------+
| Parent type | :doc:`ChoiceType </reference/forms/types/choice>` |
+-------------+------------------------------------------------------------------------+
Expand Down Expand Up @@ -113,5 +114,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/help.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
3 changes: 3 additions & 0 deletions reference/forms/types/money.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ how the input and output of the data is handled.
| | - `label_format`_ |
| | - `mapped`_ |
| | - `required`_ |
| | - `help`_ |
+-------------+---------------------------------------------------------------------+
| Parent type | :doc:`FormType </reference/forms/types/form>` |
+-------------+---------------------------------------------------------------------+
Expand Down Expand Up @@ -129,6 +130,8 @@ The default value is ``''`` (the empty string).

.. include:: /reference/forms/types/options/required.rst.inc

.. include:: /reference/forms/types/options/help.rst.inc

Form Variables
--------------

Expand Down
3 changes: 3 additions & 0 deletions reference/forms/types/number.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ that you want to use for your number.
| | - `label_format`_ |
| | - `mapped`_ |
| | - `required`_ |
| | - `help`_ |
+-------------+----------------------------------------------------------------------+
| Parent type | :doc:`FormType </reference/forms/types/form>` |
+-------------+----------------------------------------------------------------------+
Expand Down Expand Up @@ -111,3 +112,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/help.rst.inc
Loading