From 0275bef1ecc87de65b9bc436655cd94eba879656 Mon Sep 17 00:00:00 2001 From: WouterJ Date: Mon, 21 Dec 2015 18:18:37 +0100 Subject: [PATCH] Add best practice about the Form type namespace --- best_practices/forms.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/best_practices/forms.rst b/best_practices/forms.rst index b9343145a88..43e8c49fa00 100644 --- a/best_practices/forms.rst +++ b/best_practices/forms.rst @@ -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();