8000 minor #5076 Better explain that form types should be unique in the ap… · symfony/symfony-docs@6b96470 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6b96470

Browse files
committed
minor #5076 Better explain that form types should be unique in the application (javiereguiluz)
This PR was merged into the 2.3 branch. Discussion ---------- Better explain that form types should be unique in the application | Q | A | ------------- | --- | Doc fix? | yes | New docs? 8000 | no | Applies to | all | Fixed tickets | #4960 Commits ------- 7a78532 Fixed a minor grammar issue 0eb149b Recommend app_ instead of app. as form type prefix 52a5551 Recommend a better way to standardize application form types d47e751 Fixed syntax issues and provided more information 12b77af Better explain that form types should be unique in the application
2 parents cdb9350 + 7a78532 commit 6b96470

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

book/forms.rst

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,9 +1057,16 @@ 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. Unless you want to override
1064+
a built-in type, they should be different from the default Symfony types
1065+
and from any type defined by a third-party bundle installed in your application.
1066+
Consider prefixing your types with ``app_`` to avoid identifier collisions.
1067+
1068+
This new class contains all the directions needed to create the task form. It can
1069+
be used to quickly build a form object in the controller::
10631070

10641071
// src/AppBundle/Controller/DefaultController.php
10651072

0 commit comments

Comments
 (0)
0