Skip to content

Commit 5b6cc36

Browse files
committed
Merge branch '4.4' into 5.4
* 4.4: Explaining how to inject the form factory
2 parents e976964 + 89070ba commit 5b6cc36

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
@@ -371,10 +371,6 @@ you need to. If your application uses global or static variables (not usually a
371371
good idea), then you can store the object on some static class or do something
372372
similar.
373373

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

380376
Creating a simple Form
@@ -383,7 +379,8 @@ Creating a simple Form
383379
.. tip::
384380

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

0 commit comments

Comments
 (0)