Skip to content

Commit b748085

Browse files
committed
minor #14295 [Form] Added documentation for "html5" option of MoneyType and PercentType (romaricdrigon)
This PR was merged into the master branch. Discussion ---------- [Form] Added documentation for "html5" option of MoneyType and PercentType Hello, Following symfony/symfony/pull/35956, which was merged for 5.2, this PR adds the corresponding documentation. Commits ------- d8fc70d [Form] Added documentation for "html5" option of MoneyType and PercentType
2 parents e0f69b2 + d8fc70d commit b748085

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

reference/forms/types/money.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ how the input and output of the data is handled.
1717
| Options | - `currency`_ |
1818
| | - `divisor`_ |
1919
| | - `grouping`_ |
20+
| | - `html5`_ |
2021
| | - `rounding_mode`_ |
2122
| | - `scale`_ |
2223
+-------------+---------------------------------------------------------------------+
@@ -90,6 +91,21 @@ be set back on your object.
9091

9192
.. include:: /reference/forms/types/options/rounding_mode.rst.inc
9293

94+
html5
95+
~~~~~
96+
97+
**type**: ``boolean`` **default**: ``false``
98+
99+
.. versionadded:: 5.2
100+
101+
This option was introduced in Symfony 5.2.
102+
103+
If set to true, the HTML input will be rendered as a native HTML5 type="number" form.
104+
105+
.. caution::
106+
107+
As HTML5 number format is normalized, it is incompatible with ``grouping`` option.
108+
93109
scale
94110
~~~~~
95111

reference/forms/types/percent.rst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ the input.
1515
+-------------+-----------------------------------------------------------------------+
1616
| Rendered as | ``input`` ``text`` field |
1717
+-------------+-----------------------------------------------------------------------+
18-
| Options | - `rounding_mode`_ |
18+
| Options | - `html5`_ |
19+
| | - `rounding_mode`_ |
1920
| | - `scale`_ |
2021
| | - `symbol`_ |
2122
| | - `type`_ |
@@ -57,6 +58,17 @@ Field Options
5758

5859
The ``rounding_mode`` option was introduced in Symfony 5.1.
5960

61+
html5
62+
~~~~~
63+
64+
**type**: ``boolean`` **default**: ``false``
65+
66+
.. versionadded:: 5.2
67+
68+
This option was introduced in Symfony 5.2.
69+
70+
If set to true, the HTML input will be rendered as a native HTML5 type="number" form.
71+
6072
scale
6173
~~~~~
6274

0 commit comments

Comments
 (0)