Skip to content

Commit

Permalink
Better explain that form types should be unique in the application
Browse files Browse the repository at this point in the history
  • Loading branch information
javiereguiluz committed Mar 11, 2015
1 parent e49a228 commit 12b77af
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions book/forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1057,9 +1057,15 @@ 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 and, unless you want to override
a built-in type, they should be different from the default Symfony types.
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 12b77af

Please sign in to comment.