1
1
.. index ::
2
- single: Event Dispatcher; Container Aware; Dependency Injection; DIC
2
+ single: Event Dispatcher; Service container aware
3
3
4
4
The Container Aware Event Dispatcher
5
5
====================================
@@ -11,9 +11,10 @@ Introduction
11
11
------------
12
12
13
13
The :class: `Symfony\\ Component\\ EventDispatcher\\ ContainerAwareEventDispatcher ` is
14
- a special event dispatcher implementation which is coupled to the Symfony2
15
- Dependency Injection Container Component (DIC). It allows DIC services to be
16
- specified as event listeners making the event dispatcher extremely powerful.
14
+ a special event dispatcher implementation which is coupled to the service container
15
+ that is part of :doc: `the Dependency Injection component</components/dependency_injection/introduction> `.
16
+ It allows services to be specified as event listeners making the event dispatcher
17
+ extremely powerful.
17
18
18
19
Services are lazy loaded meaning the services attached as listeners will only be
19
20
created if an event is dispatched that requires those listeners.
@@ -36,12 +37,12 @@ Adding Listeners
36
37
The *Container Aware Event Dispatcher * can either load specified services
37
38
directly, or services that implement :class: `Symfony\\ Component\\ EventDispatcher\\ EventSubscriberInterface `.
38
39
39
- The following examples assume the DIC has been loaded with any services that
40
- are mentioned.
40
+ The following examples assume the service container has been loaded with any
41
+ services that are mentioned.
41
42
42
43
.. note ::
43
44
44
- Services must be marked as public in the DIC .
45
+ Services must be marked as public in the container .
45
46
46
47
Adding Services
47
48
~~~~~~~~~~~~~~~
@@ -95,4 +96,4 @@ The ``EventSubscriberInterface`` will be exactly as you would expect::
95
96
{
96
97
// ...
97
98
}
98
- }
99
+ }
0 commit comments