Skip to content

Commit

Permalink
minor #5076 Better explain that form types should be unique in the ap…
Browse files Browse the repository at this point in the history
…plication (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?     | 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
  • Loading branch information
weaverryan committed Mar 24, 2015
2 parents cdb9350 + 7a78532 commit 6b96470
Showing 1 changed file with 10 additions and 3 deletions.
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 your application.
Consider prefixing your types with ``app_`` to avoid identifier collisions.

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

0 comments on commit 6b96470

Please sign in to comment.