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 all 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 @@ -38,6 +38,7 @@ option defaults to 120 years ago to the current year.
| | |
| | - `data`_ |
| | - `disabled`_ |
| | - `help`_ |
| | - `inherit_data`_ |
| | - `invalid_message`_ |
| | - `invalid_message_parameters`_ |
Expand Down Expand Up @@ -108,6 +109,8 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:

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

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

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

.. include:: /reference/forms/types/options/invalid_message.rst.inc
Expand Down
3 changes: 3 additions & 0 deletions reference/forms/types/checkbox.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ true, if the box is unchecked, the value will be set to false.
| options | - `disabled`_ |
| | - `error_bubbling`_ |
| | - `error_mapping`_ |
| | - `help`_ |
| | - `label`_ |
| | - `label_attr`_ |
| | - `label_format`_ |
Expand Down Expand Up @@ -69,6 +70,8 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:

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

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

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

.. include:: /reference/forms/types/options/label_attr.rst.inc
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 @@ -34,6 +34,7 @@ To use this field, you must specify *either* ``choices`` or ``choice_loader`` op
| | - `data`_ |
| | - `disabled`_ |
| | - `error_mapping`_ |
| | - `help`_ |
| | - `inherit_data`_ |
| | - `label`_ |
| | - `label_attr`_ |
Expand Down Expand Up @@ -264,6 +265,8 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:

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

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

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

.. include:: /reference/forms/types/options/label.rst.inc
Expand Down
3 changes: 3 additions & 0 deletions reference/forms/types/collection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ photos).
| options | - `empty_data`_ |
| | - `error_bubbling`_ |
| | - `error_mapping`_ |
| | - `help`_ |
| | - `label`_ |
| | - `label_attr`_ |
| | - `label_format`_ |
Expand Down Expand Up @@ -448,6 +449,8 @@ error_bubbling

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

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

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

.. include:: /reference/forms/types/options/label_attr.rst.inc
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 @@ -22,6 +22,7 @@ element.
| | - `empty_data`_ |
| | - `error_bubbling`_ |
| | - `error_mapping`_ |
| | - `help`_ |
| | - `label`_ |
| | - `label_attr`_ |
| | - `label_format`_ |
Expand Down Expand Up @@ -55,6 +56,8 @@ The default value is ``''`` (the empty string).

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

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

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

.. include:: /reference/forms/types/options/label_attr.rst.inc
Expand Down
3 changes: 3 additions & 0 deletions reference/forms/types/country.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ the option manually, but then you should just use the ``ChoiceType`` directly.
| | - `data`_ |
| | - `disabled`_ |
| | - `empty_data`_ |
| | - `help`_ |
| | - `label`_ |
| | - `label_attr`_ |
| | - `label_format`_ |
Expand Down Expand Up @@ -100,6 +101,8 @@ The actual default value of this option depends on other field options:
.. include:: /reference/forms/types/options/empty_data.rst.inc
:start-after: DEFAULT_PLACEHOLDER

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

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

.. include:: /reference/forms/types/options/label_attr.rst.inc
Expand Down
3 changes: 3 additions & 0 deletions reference/forms/types/currency.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ manually, but then you should just use the ``ChoiceType`` directly.
| | - `data`_ |
| | - `disabled`_ |
| | - `empty_data`_ |
| | - `help`_ |
| | - `label`_ |
| | - `label_attr`_ |
| | - `label_format`_ |
Expand Down Expand Up @@ -89,6 +90,8 @@ The actual default value of this option depends on other field options:
.. include:: /reference/forms/types/options/empty_data.rst.inc
:start-after: DEFAULT_PLACEHOLDER

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

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

.. include:: /reference/forms/types/options/label_attr.rst.inc
Expand Down
3 changes: 3 additions & 0 deletions reference/forms/types/date.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ and can understand a number of different input formats via the `input`_ option.
| Inherited | - `data`_ |
| options | - `disabled`_ |
| | - `error_mapping`_ |
| | - `help`_ |
| | - `inherit_data`_ |
| | - `invalid_message`_ |
| | - `invalid_message_parameters`_ |
Expand Down Expand Up @@ -206,6 +207,8 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:

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

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

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

.. include:: /reference/forms/types/options/invalid_message.rst.inc
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 @@ -39,6 +39,7 @@ or an array (see `input`_).
+----------------------+----------------------------------------------------------------------------------+
| Inherited | - `data`_ |
| options | - `disabled`_ |
| | - `help`_ |
| | - `inherit_data`_ |
| | - `invalid_message`_ |
| | - `invalid_message_parameters`_ |
Expand Down Expand Up @@ -307,6 +308,8 @@ These options inherit from the :doc:`form </reference/forms/types/form>` type:

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

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

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

.. include:: /reference/forms/types/options/invalid_message.rst.inc
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 @@ -42,6 +42,7 @@ the data can be a ``DateTime`` object, a string, a timestamp or an array.
+----------------------+-----------------------------------------------------------------------------+
| Inherited | - `data`_ |
| options | - `disabled`_ |
| | - `help`_ |
| | - `inherit_data`_ |
| | - `invalid_message`_ |
| | - `invalid_message_parameters`_ |
Expand Down Expand Up @@ -194,6 +195,8 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:

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

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

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

.. include:: /reference/forms/types/options/invalid_message.rst.inc
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 @@ -15,6 +15,7 @@ The ``EmailType`` field is a text field that is rendered using the HTML5
| | - `empty_data`_ |
| | - `error_bubbling`_ |
| | - `error_mapping`_ |
| | - `help`_ |
| | - `label`_ |
| | - `label_attr`_ |
| | - `label_format`_ |
Expand Down Expand Up @@ -48,6 +49,8 @@ The default value is ``''`` (the empty string).

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

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

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

.. include:: /reference/forms/types/options/label_attr.rst.inc
Expand Down
3 changes: 3 additions & 0 deletions reference/forms/types/entity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ objects from the database.
| | - `empty_data`_ |
| | - `error_bubbling`_ |
| | - `error_mapping`_ |
| | - `help`_ |
| | - `label`_ |
| | - `label_attr`_ |
| | - `label_format`_ |
Expand Down Expand Up @@ -303,6 +304,8 @@ The actual default value of this option depends on other field options:

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

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

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

.. include:: /reference/forms/types/options/label_attr.rst.inc
Expand Down
3 changes: 3 additions & 0 deletions reference/forms/types/file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ The ``FileType`` represents a file input in your form.
| Inherited | - `disabled`_ |
| options | - `error_bubbling`_ |
| | - `error_mapping`_ |
| | - `help`_ |
| | - `label`_ |
| | - `label_attr`_ |
| | - `label_format`_ |
Expand Down Expand Up @@ -124,6 +125,8 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:

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

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

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

.. include:: /reference/forms/types/options/label_attr.rst.inc
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 @@ -19,6 +19,7 @@ on all types for which ``FormType`` is the parent.
| | - `error_bubbling`_ |
| | - `error_mapping`_ |
| | - `extra_fields_message`_ |
| | - `help`_ |
| | - `inherit_data`_ |
| | - `invalid_message`_ |
| | - `invalid_message_parameters`_ |
Expand Down Expand Up @@ -98,6 +99,8 @@ The actual default value of this option depends on other field options:

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

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

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

.. include:: /reference/forms/types/options/invalid_message.rst.inc
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 @@ -28,6 +28,7 @@ integers. By default, all non-integer values (e.g. 6.78) will round down
| | - `empty_data`_ |
| | - `error_bubbling`_ |
| | - `error_mapping`_ |
| | - `help`_ |
| | - `invalid_message`_ |
| | - `invalid_message_parameters`_ |
| | - `label`_ |
Expand Down Expand Up @@ -103,6 +104,8 @@ The default value is ``''`` (the empty string).

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

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

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

.. include:: /reference/forms/types/options/invalid_message_parameters.rst.inc
Expand Down
3 changes: 3 additions & 0 deletions reference/forms/types/language.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ manually, but then you should just use the ``ChoiceType`` directly.
| | - `data`_ |
| | - `disabled`_ |
| | - `empty_data`_ |
| | - `help`_ |
| | - `label`_ |
| | - `label_attr`_ |
| | - `label_format`_ |
Expand Down Expand Up @@ -102,6 +103,8 @@ The actual default value of this option depends on other field options:
.. include:: /reference/forms/types/options/empty_data.rst.inc
:start-after: DEFAULT_PLACEHOLDER

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

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

.. include:: /reference/forms/types/options/label_attr.rst.inc
Expand Down
Loading