Skip to content

Commit 4456aba

Browse files
author
PEHAUT-PIETRI Valmont
committed
[Form]: add a tip for debug:form command
1 parent 2f34dd2 commit 4456aba

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

forms.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,33 @@ much easier to implement.
9595
There are tens of :doc:`form types provided by Symfony </reference/forms/types>`
9696
and you can also :doc:`create your own form types </form/create_custom_field_type>`.
9797

98+
.. tip::
99+
100+
You can use the ``debug:form`` to list all the available types, type
101+
extensions and type guessers in your application:
102+
103+
.. code-block:: terminal
104+
105+
$ php bin/console debug:form
106+
107+
If you pass a form type as the first argument, the command shows the options
108+
defined for that type, its parents and its extensions.
109+
For built-in types the short classname is enough, however other types
110+
require the FQCN:
111+
112+
.. code-block:: terminal
113+
114+
$ php bin/console debug:form BirthdayType
115+
116+
If you pass both a form type class and an option name, the command displays
117+
the full definition of the given option:
118+
119+
.. code-block:: terminal
120+
121+
$ php bin/console debug:form BirthdayType label_attr
122+
123+
You can see all the command options by running ``--help``.
124+
98125
Building Forms
99126
--------------
100127

0 commit comments

Comments
 (0)