File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
components/dependency_injection Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -236,6 +236,7 @@ a parent for a service.
236
236
.. code-block :: php
237
237
238
238
use Symfony\Component\DependencyInjection\Definition;
239
+ use Symfony\Component\DependencyInjection\DefinitionDecorator;
239
240
use Symfony\Component\DependencyInjection\Reference;
240
241
241
242
// ...
@@ -284,6 +285,12 @@ can only be used as a parent service and cannot be used directly as a service
284
285
to inject and will be removed at compile time. In other words, it exists merely
285
286
as a "template" that other services can use.
286
287
288
+ .. note ::
289
+
290
+ In order for parent dependencies to resolve, the ``ContainerBuilder `` must
291
+ first be compiled. See :doc: `/components/dependency_injection/compilation `
292
+ for more details.
293
+
287
294
Overriding Parent Dependencies
288
295
------------------------------
289
296
@@ -364,6 +371,7 @@ to the ``NewsletterManager`` class, the config would look like this:
364
371
.. code-block :: php
365
372
366
373
use Symfony\Component\DependencyInjection\Definition;
374
+ use Symfony\Component\DependencyInjection\DefinitionDecorator;
367
375
use Symfony\Component\DependencyInjection\Reference;
368
376
369
377
// ...
@@ -482,6 +490,7 @@ If you had the following config:
482
490
.. code-block :: php
483
491
484
492
use Symfony\Component\DependencyInjection\Definition;
493
+ use Symfony\Component\DependencyInjection\DefinitionDecorator;
485
494
use Symfony\Component\DependencyInjection\Reference;
486
495
487
496
// ...
You can’t perform that action at this time.
0 commit comments