Zend Framework
3.0
|
Interface for self-registering event listeners. More...
Public Member Functions | |
attach (EventManagerInterface $events, $priority=1) | |
Attach one or more listeners. | |
detach (EventManagerInterface $events) | |
Detach all previously attached listeners. | |
Interface for self-registering event listeners.
Classes implementing this interface may be registered by name or instance with an EventManager, without an event name. The attach() method will then be called with the current EventManager instance, allowing the class to wire up one or more listeners.
attach | ( | EventManagerInterface | $events, |
$priority = 1 |
|||
) |
Attach one or more listeners.
Implementors may add an optional $priority argument; the EventManager implementation will pass this to the aggregate.
EventManagerInterface | $events | |
int | $priority |
Implemented in LocatorRegistrationListener, ServiceListener, LazyListenerAggregate, ConfigListener, ViewManager, PhpRendererStrategy, SendResponseListener, DispatchListener, ModuleLoaderListener, ExceptionStrategy, HttpMethodListener, JsonStrategy, RouteNotFoundStrategy, ViewManager, DefaultRenderingStrategy, RouteNotFoundStrategy, ElementAnnotationsListener, FormAnnotationsListener, HydratorListener, DefaultListenerAggregate, FeedStrategy, ExceptionStrategy, DefaultRenderingStrategy, InjectRoutematchParamsListener, Serializer, IgnoreUserAbort, ModuleRouteListener, MiddlewareListener, RouteListener, ClearExpiredByFactor, OptimizeByFactor, and ExceptionHandler.
detach | ( | EventManagerInterface | $events | ) |
Detach all previously attached listeners.
EventManagerInterface | $events |
Implemented in ServiceListener, ModuleLoaderListener, DefaultListenerAggregate, and AbstractListenerAggregate.