Skip to content

Commit 12b77af

Browse files
committed
Better explain that form types should be unique in the application
1 parent e49a228 commit 12b77af

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

book/forms.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,9 +1057,15 @@ that will house the logic for building the task form::
10571057
}
10581058
}
10591059

1060-
This new class contains all the directions needed to create the task form
1061-
(note that the ``getName()`` method should return a unique identifier for this
1062-
form "type"). It can be used to quickly build a form object in the controller::
1060+
.. caution::
1061+
1062+
The ``getName()`` method returns the identifier of this form "type". These
1063+
identifiers must be unique in the application and, unless you want to override
1064+
a built-in type, they should be different from the default Symfony types.
1065+
Consider prefixing your types with ``app_`` to avoid identifier collisions.
1066+
1067+
This new class contains all the directions needed to create the task form. It can
1068+
be used to quickly build a form object in the controller:
10631069

10641070
// src/AppBundle/Controller/DefaultController.php
10651071

0 commit comments

Comments
 (0)