Fully Qualified Name: | Zend\EventManager\LazyListener |
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.
Name | Description | Defined By |
---|---|---|
__construct() | LazyListener | |
__invoke() | Use the listener as an invokable, allowing direct attachment to an event manager. | LazyListener |
Parameter Name | Type | Description |
---|---|---|
$definition | array | |
$container | \ContainerInterface | |
$env | array |
Returns:
Use the listener as an invokable, allowing direct attachment to an event manager.
Parameter Name | Type | Description |
---|---|---|
$event | \EventInterface |
Returns: callable