From e0137f59b0eb4d3004b8cb8972f512a769784b22 Mon Sep 17 00:00:00 2001 From: Iltar van der Berg Date: Fri, 9 Feb 2018 20:25:24 +0100 Subject: [PATCH 1/2] Added a note about named form types --- forms.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/forms.rst b/forms.rst index 67768816be3..92ead359263 100644 --- a/forms.rst +++ b/forms.rst @@ -703,6 +703,12 @@ the choice is ultimately up to you. $form->get('agreeTerms')->setData(true); + +.. note:: + A form name is generated from the type class name, if you want to set it + explicitly, use :method:`FormFactoryInterface::createNamed() `. + You can even suppress the name completely by setting it to an empty string. + Final Thoughts -------------- From 8d246c465c5801bd24f291e0b31dfd9fca173460 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Sat, 10 Feb 2018 16:45:29 +0100 Subject: [PATCH 2/2] Minor reword --- forms.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/forms.rst b/forms.rst index 92ead359263..d45fdadcd51 100644 --- a/forms.rst +++ b/forms.rst @@ -705,8 +705,9 @@ the choice is ultimately up to you. .. note:: - A form name is generated from the type class name, if you want to set it - explicitly, use :method:`FormFactoryInterface::createNamed() `. + + The form name is automatically generated from the type class name. If you want + to modify it, use the :method:`Symfony\\Component\\Form\\FormFactoryInterface::createNamed` method. You can even suppress the name completely by setting it to an empty string. Final Thoughts