8000 Merge branch '7.1' into 7.2 · symfony/symfony-docs@0f3d37c · GitHub
[go: up one dir, main page]

Skip to content

Commit 0f3d37c

Browse files
committed
Merge branch '7.1' into 7.2
* 7.1: Add the missing note on how to inject a service into the controller
2 parents 05066a0 + 2bbf70e commit 0f3d37c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

controller.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ These are used for rendering templates, sending emails, querying the database an
176176
any other "work" you can think of.
177177

178178
If you need a service in a controller, type-hint an argument with its class
179-
(or interface) name. Symfony will automatically pass you the service you need::
179+
(or interface) name and Symfony will inject it automatically. This requires
180+
your :doc:`controller to be registered as a service </controller/service>`::
180181

181182
use Psr\Log\LoggerInterface;
182183
use Symfony\Component\HttpFoundation\Response;

0 commit comments

Comments
 (0)
0