From ebe353afb6f5c7863f54eea5ae63315d3d1610f7 Mon Sep 17 00:00:00 2001 From: Oliver Hoff Date: Sat, 6 Feb 2016 17:35:07 +0100 Subject: [PATCH 1/2] #6232 update forms as services section this is to reflect recent changes to form type handling since symfony 2.8 --- best_practices/forms.rst | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/best_practices/forms.rst b/best_practices/forms.rst index 921a51ddeb8..51a69a649ea 100644 --- a/best_practices/forms.rst +++ b/best_practices/forms.rst @@ -71,13 +71,9 @@ Registering Forms as Services You can also :ref:`register your form type as a service `. -But this is *not* recommended unless you plan to reuse the new form type in many -places or embed it in other forms directly or via the -:doc:`CollectionType `. - -For most forms that are used only to edit or create something, registering -the form as a service is over-kill, and makes it more difficult to figure -out exactly which form class is being used in a controller. +This is only needed if your form type requires some dependencies to be injected +by the container, otherwise it is just unnecessary overhead and therefore +*not* recommended to do this for each and every form type class. Form Button Configuration ------------------------- From c32e1b9837b4b4ee883000d656a6a66ced2289a9 Mon Sep 17 00:00:00 2001 From: Oliver Hoff Date: Sat, 6 Feb 2016 17:58:06 +0100 Subject: [PATCH 2/2] optimize wording for forms as services section --- best_practices/forms.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/best_practices/forms.rst b/best_practices/forms.rst index 51a69a649ea..73f2c0d775c 100644 --- a/best_practices/forms.rst +++ b/best_practices/forms.rst @@ -72,8 +72,8 @@ Registering Forms as Services You can also :ref:`register your form type as a service `. This is only needed if your form type requires some dependencies to be injected -by the container, otherwise it is just unnecessary overhead and therefore -*not* recommended to do this for each and every form type class. +by the container, otherwise it is unnecessary overhead and therefore *not* +recommended to do this for all form type classes. Form Button Configuration -------------------------