-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better explain that form types should be unique in the application #5076
Changes from 2 commits
12b77af
d47e751
52a5551
0eb149b
7a78532
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1057,9 +1057,16 @@ that will house the logic for building the task form:: | |
} | ||
} | ||
|
||
This new class contains all the directions needed to create the task form | ||
(note that the ``getName()`` method should return a unique identifier for this | ||
form "type"). It can be used to quickly build a form object in the controller:: | ||
.. caution:: | ||
|
||
The ``getName()`` method returns the identifier of this form "type". These | ||
identifiers must be unique in the application. Unless you want to override | ||
a built-in type, they should be different from the default Symfony types | ||
and from any type defined by a third-party bundle installed in you application. | ||
Consider prefixing your types with ``app_`` to avoid identifier collisions. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should this become a best practice ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the best practices, we use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree with you. I've just updated the PR with your suggestion. |
||
|
||
This new class contains all the directions needed to create the task form. It can | ||
be used to quickly build a form object in the controller:: | ||
|
||
// src/AppBundle/Controller/DefaultController.php | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
your