Zend Framework
3.0
|
Lazy listener instance. More...
Public Member Functions | |
__construct (array $definition, ContainerInterface $container, array $env=[]) | |
__invoke (EventInterface $event) | |
Use the listener as an invokable, allowing direct attachment to an event manager. | |
Lazy listener instance.
Used to allow lazy creation of listeners via a dependency injection container.
Lazy listener definitions have the following members:
If desired, you can pass $env at instantiation; this will be passed to the container's `build()` method, if it has one, when creating the listener instance.
Pass instances directly to the event manager's `attach()` method as the listener argument.
__construct | ( | array | $definition, |
ContainerInterface | $container, | ||
array | $env = [] |
||
) |
array | $definition | |
ContainerInterface | $container | |
array | $env |
__invoke | ( | EventInterface | $event | ) |
Use the listener as an invokable, allowing direct attachment to an event manager.
EventInterface | $event |