Skip to content

Commit e015131

Browse files
committed
Add the missing note on how to inject a service into the controller
1 parent 319b504 commit e015131

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
@@ -178,7 +178,8 @@ These are used for rendering templates, sending emails, querying the database an
178178
any other "work" you can think of.
179179

180180
If you need a service in a controller, type-hint an argument with its class
181-
(or interface) name. Symfony will automatically pass you the service you need::
181+
(or interface) name. Symfony will automatically pass you the service you need.
182+
Make sure to :doc:`register the controller as a service or tag it with 'controller.service_arguments' </controller/service>`::
182183

183184
use Psr\Log\LoggerInterface;
184185
use Symfony\Component\HttpFoundation\Response;

0 commit comments

Comments
 (0)