Skip to content

Commit 2c54c4c

Browse files
committed
minor #18824 [Form] : add a tip for debug:form command (Valmonzo)
This PR was merged into the 5.4 branch. Discussion ---------- [Form] : add a tip for `debug:form` command Hello, I wanted to use the `debug:form`, and I noticed there is no mention about it in the documentation. I think it should be a good tip to have. 👍🏽 What do you think? Commits ------- 4456aba [Form]: add a tip for `debug:form` command
2 parents 76213a3 + 4456aba commit 2c54c4c

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)