Skip to content
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

Merged
merged 5 commits into from
Mar 24, 2015
Merged
Changes from 3 commits
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
13 changes: 10 additions & 3 deletions book/forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
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.

Sorry, Javier, we also need to switch back to app_ here as @stof explained in #5077.

Copy link
Member Author

Choose a reason for hiding this comment

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

You are right. It's done in 0eb149b. Thanks.


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

Expand Down