@@ -142,9 +142,9 @@ the service container *how* to instantiate it:
142
142
// app/config/services.php
143
143
TODO
144
144
145
- That's it! Thanks to the ``AppBundle\ `` line and ``resource `` key below it, all
146
- classes in the ``src/AppBundle/Service `` directory (and a few other directories)
147
- will automatically be added to the container .
145
+ That's it! Thanks to the ``AppBundle\ `` line and ``resource `` key below it, a service
146
+ will be registered for each class in the ``src/AppBundle/Service `` directory (and
147
+ the other directories listed) .
148
148
149
149
Each service's "key" is its class name. You can use it immediately inside your controller::
150
150
@@ -210,11 +210,11 @@ and set it on a ``$logger`` property::
210
210
}
211
211
212
212
That's it! The container will *automatically * know to pass the ``logger `` service
213
- when instantiating the ``MessageGenerator ``? How does it know to do this?
213
+ when instantiating the ``MessageGenerator ``. How does it know to do this?
214
214
:doc: `Autowiring </service_container/autowiring >`. The key is the ``LoggerInterface ``
215
215
type-hint in your ``__construct() `` method and the ``autowire: true `` config in
216
216
``services.yml ``. When you type-hint an argument, the container will automatically
217
- find the matching service. If it can't or there is any ambuiguity , you'll see a clear
217
+ find the matching service. If it can't or there is any ambiguity , you'll see a clear
218
218
exception suggesting how to fix it.
219
219
220
220
Be sure to read more about :doc: `autowiring </service_container/autowiring >`.
0 commit comments