Class LazyListener

Summary

Fully Qualified Name: Zend\EventManager\LazyListener

Description

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.

Methods

Name Description Defined By
__construct() LazyListener
__invoke() Use the listener as an invokable, allowing direct attachment to an event manager. LazyListener

Method Details

__construct()

Parameter Name Type Description
$definition array
$container \ContainerInterface
$env array

Returns:

__invoke()

Use the listener as an invokable, allowing direct attachment to an event manager.

Parameter Name Type Description
$event \EventInterface

Returns: callable

Top