8000 Better explain that form types should be unique in the application by javiereguiluz · Pull Request #5076 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Better explain that form types should be unique in the application #5076

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

Merged
merged 5 commits into from
Mar 24, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed syntax issues and provided more information
  • Loading branch information
javiereguiluz committed Mar 12, 2015
commit d47e751f551b5a405498d6ff721f139286a9c0f0
7 changes: 4 additions & 3 deletions book/forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1060,12 +1060,13 @@ that will house the logic for building the task form::
.. caution::

The ``getName()`` method returns the identifier of this form "type". These
identifiers must be unique in the application and, unless you want to override
a built-in type, they should be different from the default Symfony types.
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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

your

Consider prefixing your types with ``app_`` to avoid identifier collisions.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this become a best practice ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the best practices, we use app. (dot instead of underscore) for service names. Should we follow this convention here too?

Copy link
Member Author

Choose a reason for hiding this comment

The 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:
be used to quickly build a form object in the controller::

// src/AppBundle/Controller/DefaultController.php

Expand Down
0