Skip to content
Merged
Changes from all 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
8 changes: 7 additions & 1 deletion best_practices/forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,17 @@ form in its own PHP class::
}
}

.. best-practice::

Put the form type classes in the ``AppBundle\Form`` namespace, unless you
use other custom form classes like data transformers.

To use the class, use ``createForm`` and instantiate the new class::

use AppBundle\Form\PostType;
// ...
use AppBundle\Form\PostType;

// ...
public function newAction(Request $request)
{
$post = new Post();
Expand Down