Skip to content

[WIP][#2362] Documenting missing form options #2427

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 5 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: 2 additions & 1 deletion reference/forms/types/date.rst
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,5 @@ These options inherit from the :doc:`field</reference/forms/types/field>` type:

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

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

6 changes: 5 additions & 1 deletion reference/forms/types/datetime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ data can be a ``DateTime`` object, a string, a timestamp or an array.
| | - `with_seconds`_ |
| | - `data_timezone`_ |
| | - `user_timezone`_ |
| | - `empty_value`_ |
+----------------------+-----------------------------------------------------------------------------+
| Inherited | - `invalid_message`_ |
| options | - `invalid_message_parameters`_ |
Expand Down Expand Up @@ -97,11 +98,14 @@ for more details.

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

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

Inherited options
-----------------

These options inherit from the :doc:`field</reference/forms/types/field>` type:

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

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

18 changes: 16 additions & 2 deletions reference/forms/types/field.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,24 @@ The ``field`` type predefines a couple of options:

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

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

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

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

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

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

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

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

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

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

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

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

.. include:: /reference/forms/types/options/invalid_message_parameters.rst.inc
8 changes: 7 additions & 1 deletion reference/forms/types/form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,10 @@
form Field Type
===============

See :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\FormType`.
See :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\FormType`.

virtual
-------

See :doc:`How to use the Virtual Form Field Option</cookbook/form/use_virtuals_forms>`

3 changes: 3 additions & 0 deletions reference/forms/types/integer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ integers. By default, all non-integer values (e.g. 6.78) will round down (e.g. 6
| Rendered as | ``input`` ``text`` field |
+-------------+-----------------------------------------------------------------------+
| Options | - `rounding_mode`_ |
| | - `precision`_ |
| | - `grouping`_ |
+-------------+-----------------------------------------------------------------------+
| Inherited | - `required`_ |
Expand All @@ -33,6 +34,8 @@ integers. By default, all non-integer values (e.g. 6.78) will round down (e.g. 6
Field Options
-------------

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

rounding_mode
~~~~~~~~~~~~~

Expand Down
10 changes: 1 addition & 9 deletions reference/forms/types/number.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,7 @@ you want to use for your number.
Field Options
-------------

precision
~~~~~~~~~

**type**: ``integer`` **default**: Locale-specific (usually around ``3``)

This specifies how many decimals will be allowed until the field rounds
the submitted value (via ``rounding_mode``). For example, if ``precision``
is set to ``2``, a submitted value of ``20.123`` will be rounded to,
for example, ``20.12`` (depending on your ``rounding_mode``).
.. include:: /reference/forms/types/options/precision.rst.inc

rounding_mode
~~~~~~~~~~~~~
Expand Down
9 changes: 9 additions & 0 deletions reference/forms/types/options/precision.rst.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
precision
~~~~~~~~~

**type**: ``integer`` **default**: Locale-specific (usually around ``3``)

This specifies how many decimals will be allowed until the field rounds
the submitted value (via ``rounding_mode``). For example, if ``precision``
is set to ``2``, a submitted value of ``20.123`` will be rounded to,
for example, ``20.12`` (depending on your ``rounding_mode``).
6 changes: 5 additions & 1 deletion reference/forms/types/time.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ as a ``DateTime`` object, a string, a timestamp or an array.
| | - `seconds`_ |
| | - `data_timezone`_ |
| | - `user_timezone`_ |
| | - `empty_data`_ |
+----------------------+-----------------------------------------------------------------------------+
| Inherited | - `invalid_message`_ |
| options | - `invalid_message_parameters`_ |
Expand Down Expand Up @@ -108,11 +109,14 @@ this format.

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

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

Inherited options
-----------------

These options inherit from the :doc:`field</reference/forms/types/field>` type:

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

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