Skip to content

Commit dd27a54

Browse files
committed
minor #14953 [Form][Uid] Document the new Uuid and Ulid form types (javiereguiluz)
This PR was merged into the 5.3-dev branch. Discussion ---------- [Form][Uid] Document the new Uuid and Ulid form types Fixes #14856. Commits ------- 6c790bc [Form] Document the new Uuid and Ulid form types
2 parents 86a577a + 6c790bc commit dd27a54

File tree

5 files changed

+209
-0
lines changed

5 files changed

+209
-0
lines changed

components/uid.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ Installation
2121
2222
.. include:: /components/require_autoload.rst.inc
2323

24+
.. _uuid:
25+
2426
UUIDs
2527
-----
2628

@@ -214,6 +216,8 @@ of the UUID parameters::
214216
}
215217
}
216218

219+
.. _ulid:
220+
217221
ULIDs
218222
-----
219223

reference/forms/types.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ Form Types Reference
4141
types/file
4242
types/radio
4343

44+
types/uuid
45+
types/ulid
46+
4447
types/collection
4548
types/repeated
4649

reference/forms/types/map.rst.inc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ Other Fields
4343
* :doc:`FileType </reference/forms/types/file>`
4444
* :doc:`RadioType </reference/forms/types/radio>`
4545

46+
UID Fields
47+
~~~~~~~~~~
48+
49+
* :doc:`UuidType </reference/forms/types/uuid>`
50+
* :doc:`UlidType </reference/forms/types/ulid>`
51+
4652
Field Groups
4753
~~~~~~~~~~~~
4854

reference/forms/types/ulid.rst

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
.. index::
2+
single: Forms; Fields; UuidType
3+
4+
UlidType Field
5+
==============
6+
7+
.. versionadded:: 5.3
8+
9+
The ``UlidType`` field was introduced in Symfony 5.3.
10+
11+
Renders an input text field with the ULID string value and transforms it back to
12+
a proper :ref:`Ulid object <ulid>` when submitting the form.
13+
14+
+---------------------------+-----------------------------------------------------------------------+
15+
| Rendered as | ``input`` ``text`` field |
16+
+---------------------------+-----------------------------------------------------------------------+
17+
| Options | (none) |
18+
+---------------------------+-----------------------------------------------------------------------+
19+
| Overridden options | - `compound`_ |
20+
| | - `invalid_message`_ |
21+
+---------------------------+-----------------------------------------------------------------------+
22+
| Inherited options | - `attr`_ |
23+
| | - `data`_ |
24+
| | - `disabled`_ |
25+
| | - `empty_data`_ |
26+
| | - `error_bubbling`_ |
27+
| | - `error_mapping`_ |
28+
| | - `help`_ |
29+
| | - `help_attr`_ |
30+
| | - `help_html`_ |
31+
| | - `invalid_message_parameters`_ |
32+
| | - `label`_ |
33+
| | - `label_attr`_ |
34+
| | - `label_format`_ |
35+
| | - `mapped`_ |
36+
| | - `required`_ |
37+
| | - `row_attr`_ |
38+
+---------------------------+-----------------------------------------------------------------------+
39+
| Default invalid message | Please enter a valid ULID. |
40+
+---------------------------+-----------------------------------------------------------------------+
41+
| Legacy invalid message | The value {{ value }} is not valid. |
42+
+---------------------------+-----------------------------------------------------------------------+
43+
| Parent type | :doc:`FormType </reference/forms/types/form>` |
44+
+---------------------------+-----------------------------------------------------------------------+
45+
| Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\UlidType` |
46+
+---------------------------+-----------------------------------------------------------------------+
47+
48+
.. include:: /reference/forms/types/options/_debug_form.rst.inc
49+
50+
Overridden Options
51+
------------------
52+
53+
.. include:: /reference/forms/types/options/compound_type.rst.inc
54+
55+
.. include:: /reference/forms/types/options/invalid_message.rst.inc
56+
57+
Inherited Options
58+
-----------------
59+
60+
These options inherit from the :doc:`FormType </reference/forms/types/form>`:
61+
62+
.. include:: /reference/forms/types/options/attr.rst.inc
63+
64+
.. include:: /reference/forms/types/options/data.rst.inc
65+
66+
.. include:: /reference/forms/types/options/disabled.rst.inc
67+
68+
.. include:: /reference/forms/types/options/empty_data.rst.inc
69+
:end-before: DEFAULT_PLACEHOLDER
70+
71+
The default value is ``''`` (the empty string).
72+
73+
.. include:: /reference/forms/types/options/empty_data.rst.inc
74+
:start-after: DEFAULT_PLACEHOLDER
75+
76+
.. include:: /reference/forms/types/options/error_bubbling.rst.inc
77+
78+
.. include:: /reference/forms/types/options/error_mapping.rst.inc
79+
80+
.. include:: /reference/forms/types/options/help.rst.inc
81+
82+
.. include:: /reference/forms/types/options/help_attr.rst.inc
83+
84+
.. include:: /reference/forms/types/options/help_html.rst.inc
85+
86+
.. include:: /reference/forms/types/options/invalid_message_parameters.rst.inc
87+
88+
.. include:: /reference/forms/types/options/label.rst.inc
89+
90+
.. include:: /reference/forms/types/options/label_attr.rst.inc
91+
92+
.. include:: /reference/forms/types/options/label_format.rst.inc
93+
94+
.. include:: /reference/forms/types/options/mapped.rst.inc
95+
96+
.. include:: /reference/forms/types/options/required.rst.inc
97+
98+
.. include:: /reference/forms/types/options/row_attr.rst.inc

reference/forms/types/uuid.rst

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
.. index::
2+
single: Forms; Fields; UuidType
3+
4+
UuidType Field
5+
==============
6+
7+
.. versionadded:: 5.3
8+
9+
The ``UuidType`` field was introduced in Symfony 5.3.
10+
11+
Renders an input text field with the UUID string value and transforms it back to
12+
a proper :ref:`Uuid object <uuid>` when submitting the form.
13+
14+
+---------------------------+-----------------------------------------------------------------------+
15+
| Rendered as | ``input`` ``text`` field |
16+
+---------------------------+-----------------------------------------------------------------------+
17+
| Options | (none) |
18+
+---------------------------+-----------------------------------------------------------------------+
19+
| Overridden options | - `compound`_ |
20+
| | - `invalid_message`_ |
21+
+---------------------------+-----------------------------------------------------------------------+
22+
| Inherited options | - `attr`_ |
23+
| | - `data`_ |
24+
| | - `disabled`_ |
25+
| | - `empty_data`_ |
26+
| | - `error_bubbling`_ |
27+
| | - `error_mapping`_ |
28+
| | - `help`_ |
29+
| | - `help_attr`_ |
30+
| | - `help_html`_ |
31+
| | - `invalid_message_parameters`_ |
32+
| | - `label`_ |
33+
| | - `label_attr`_ |
34+
| | - `label_format`_ |
35+
| | - `mapped`_ |
36+
| | - `required`_ |
37+
| | - `row_attr`_ |
38+
+---------------------------+-----------------------------------------------------------------------+
39+
| Default invalid message | Please enter a valid UUID. |
40+
+---------------------------+-----------------------------------------------------------------------+
41+
| Legacy invalid message | The value {{ value }} is not valid. |
42+
+---------------------------+-----------------------------------------------------------------------+
43+
| Parent type | :doc:`FormType </reference/forms/types/form>` |
44+
+---------------------------+-----------------------------------------------------------------------+
45+
| Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\UuidType` |
46+
+---------------------------+-----------------------------------------------------------------------+
47+
48+
.. include:: /reference/forms/types/options/_debug_form.rst.inc
49+
50+
Overridden Options
51+
------------------
52+
53+
.. include:: /reference/forms/types/options/compound_type.rst.inc
54+
55+
.. include:: /reference/forms/types/options/invalid_message.rst.inc
56+
57+
Inherited Options
58+
-----------------
59+
60+
These options inherit from the :doc:`FormType </reference/forms/types/form>`:
61+
62+
.. include:: /reference/forms/types/options/attr.rst.inc
63+
64+
.. include:: /reference/forms/types/options/data.rst.inc
65+
66+
.. include:: /reference/forms/types/options/disabled.rst.inc
67+
68+
.. include:: /reference/forms/types/options/empty_data.rst.inc
69+
:end-before: DEFAULT_PLACEHOLDER
70+
71+
The default value is ``''`` (the empty string).
72+
73+
.. include:: /reference/forms/types/options/empty_data.rst.inc
74+
:start-after: DEFAULT_PLACEHOLDER
75+
76+
.. include:: /reference/forms/types/options/error_bubbling.rst.inc
77+
78+
.. include:: /reference/forms/types/options/error_mapping.rst.inc
79+
80+
.. include:: /reference/forms/types/options/help.rst.inc
81+
82+
.. include:: /reference/forms/types/options/help_attr.rst.inc
83+
84+
.. include:: /reference/forms/types/options/help_html.rst.inc
85+
86+
.. include:: /reference/forms/types/options/invalid_message_parameters.rst.inc
87+
88+
.. include:: /reference/forms/types/options/label.rst.inc
89+
90+
.. include:: /reference/forms/types/options/label_attr.rst.inc
91+
92+
.. include:: /reference/forms/types/options/label_format.rst.inc
93+
94+
.. include:: /reference/forms/types/options/mapped.rst.inc
95+
96+
.. include:: /reference/forms/types/options/required.rst.inc
97+
98+
.. include:: /reference/forms/types/options/row_attr.rst.inc

0 commit comments

Comments
 (0)