Skip to content

Commit 89070ba

Browse files
committed
minor #16364 [Form] Explaining how to inject the form factory (ThomasLandauer)
This PR was merged into the 4.4 branch. Discussion ---------- [Form] Explaining how to inject the form factory The other sentence I deleted was just repeating what was already said a few lines above. Commits ------- ceedcca Explaining how to inject the form factory
2 parents d61fdbc + ceedcca commit 89070ba

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

components/form.rst

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,6 @@ you need to. If your application uses global or static variables (not usually a
370370
good idea), then you can store the object on some static class or do something
371371
similar.
372372

373-
Regardless of how you architect your application, remember that you
374-
should only have one form factory and that you'll need to be able to access
375-
it throughout your application.
376-
377373
.. _component-form-intro-create-simple-form:
378374

379375
Creating a simple Form
@@ -382,7 +378,8 @@ Creating a simple Form
382378
.. tip::
383379

384380
If you're using the Symfony Framework, then the form factory is available
385-
automatically as a service called ``form.factory``. Also, the default
381+
automatically as a service called ``form.factory``, you can inject it as
382+
``Symfony\Component\Form\FormFactoryInterface``. Also, the default
386383
base controller class has a :method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\AbstractController::createFormBuilder`
387384
method, which is a shortcut to fetch the form factory and call ``createBuilder()``
388385
on it.

0 commit comments

Comments
 (0)