Sandbox > ZF2 Events Reference
Zend Framework 2 Event Reference
The following lists represent the structure of events and listeners in a
standard Zend Framework 2 Application. It starts with the module manager events
that are triggered when Zend\ModuleManager\ModuleManager::loadModules() is
called followed by the application events triggered by
Zend\Mvc\Application::bootstrap() and Zend\Mvc\Application::run(). Listeners
are listed by their priority and events are structure in a way that tries to
illustrate where they triggered in the application. However events may also be
triggered differently depending on application state. For example the
dispatch.error and render.error events may be triggered at different places
when an error is detected with the application. The event structure is also
specific to ZF2 version 2.4.2. Different version may
have different listener and event triggers.
Read more here: http://sporkcode.com/blog/2015/05/20/events-reference-for-zf2-applications/
Module Events
(Zend\ModuleManager\ModuleManager, module_manager)
loadModules
Zend\Loader\ModuleAutoloader ::
register
Priority
9000
Identifier
*
Zend\ModuleManager\Listener\ConfigListener ::
onloadModulesPre
Priority
1000
Identifier
*
Zend\ModuleManager\ModuleManager ::
onLoadModules
Priority
1
Identifier
*
Load Module
(Zend\ModuleManager\ModuleManager, module_manager)
loadModule.resolve
Zend\ModuleManager\Listener\ModuleResolverListener ::
INVOKABLE
Priority
1
Identifier
*
loadModule
Zend\ModuleManager\Listener\AutoloaderListener ::
INVOKABLE
Priority
9000
Identifier
*
Zend\ModuleManager\Listener\ModuleDependencyCheckerListener ::
INVOKABLE
Priority
8000
Identifier
*
Zend\ModuleManager\Listener\InitTrigger ::
INVOKABLE
Priority
1
Identifier
*
Zend\ModuleManager\Listener\OnBootstrapListener ::
INVOKABLE
Priority
1
Identifier
*
Zend\ModuleManager\Listener\LocatorRegistrationListener ::
onLoadModule
Priority
1
Identifier
*
Zend\ModuleManager\Listener\ConfigListener ::
onLoadModule
Priority
1
Identifier
*
Zend\ModuleManager\Listener\ServiceListener ::
onLoadModule
Priority
1
Identifier
*
Zend\ModuleManager\Listener\LocatorRegistrationListener ::
onLoadModules
Priority
-1000
Identifier
*
Zend\ModuleManager\Listener\ConfigListener ::
onLoadModules
Priority
-1000
Identifier
*
Configure Modules
(Zend\ModuleManager\ModuleManager, module_manager)
mergeConfig
Zend\ModuleManager\Listener\ConfigListener ::
onMergeConfig
Priority
1000
Identifier
*
loadModules.post
Zend\ModuleManager\Listener\ServiceListener ::
onLoadModulesPost
Priority
1
Identifier
*
Application Events
(Zend\Mvc\Application)
bootstrap
Zend\Mvc\View\Http\ViewManager ::
onBootstrap
Priority
10000
Identifier
*
Zend\ModuleManager\Listener\LocatorRegistrationListener ::
CLOSURE
Priority
1000
Identifier
Zend\Mvc\Application
route
Zend\Mvc\HttpMethodListener ::
onRoute
Priority
10000
Identifier
*
Zend\Mvc\RouteListener ::
onRoute
Priority
1
Identifier
*
dispatch
Zend\Mvc\DispatchListener ::
onDispatch
Priority
1
Identifier
*
Controller Events
(Zend\Mvc\Controller\AbstractController, SporkTools\Core\View\Helper\Controller, SporkTools, Zend\ServiceManager\ServiceLocatorAwareInterface, Zend\Mvc\InjectApplicationEventInterface, Zend\EventManager\EventsCapableInterface, Zend\EventManager\EventManagerAwareInterface, Zend\Stdlib\DispatchableInterface)
dispatch
SporkTools\Core\View\Helper\Controller ::
onDispatch
Priority
1
Identifier
*
Zend\Mvc\View\Http\CreateViewModelListener ::
createViewModelFromArray
Priority
-80
Identifier
Zend\Stdlib\DispatchableInterface
Zend\Mvc\View\Http\CreateViewModelListener ::
createViewModelFromNull
Priority
-80
Identifier
Zend\Stdlib\DispatchableInterface
Zend\Mvc\View\Http\RouteNotFoundStrategy ::
prepareNotFoundViewModel
Priority
-90
Identifier
Zend\Stdlib\DispatchableInterface
Zend\Mvc\View\Http\InjectTemplateListener ::
injectTemplate
Priority
-90
Identifier
Zend\Stdlib\DispatchableInterface
Zend\Mvc\View\Http\InjectViewModelListener ::
injectViewModel
Priority
-100
Identifier
Zend\Stdlib\DispatchableInterface
Zend\Mvc\View\Http\RouteNotFoundStrategy ::
prepareNotFoundViewModel
Priority
-90
Identifier
*
dispatch.error
Zend\Mvc\View\Http\RouteNotFoundStrategy ::
detectNotFoundError
Priority
1
Identifier
*
Zend\Mvc\View\Http\RouteNotFoundStrategy ::
prepareNotFoundViewModel
Priority
1
Identifier
*
Zend\Mvc\View\Http\ExceptionStrategy ::
prepareExceptionViewModel
Priority
1
Identifier
*
Zend\Mvc\View\Http\InjectViewModelListener ::
injectViewModel
Priority
-100
Identifier
*
render
Zend\Mvc\View\Http\DefaultRenderingStrategy ::
render
Priority
-10000
Identifier
*
View Events
(Zend\View\View)
renderer
Zend\View\Strategy\PhpRendererStrategy ::
selectRenderer
Priority
1
Identifier
*
response
Zend\View\Strategy\PhpRendererStrategy ::
injectResponse
Priority
1
Identifier
*
render.error
Zend\Mvc\View\Http\ExceptionStrategy ::
prepareExceptionViewModel
Priority
1
Identifier
*
Zend\Mvc\View\Http\InjectViewModelListener ::
injectViewModel
Priority
-100
Identifier
*
Zend\Mvc\View\Http\DefaultRenderingStrategy ::
render
Priority
-10000
Identifier
*
View Events
(Zend\View\View)
renderer
Zend\View\Strategy\PhpRendererStrategy ::
selectRenderer
Priority
1
Identifier
*
response
Zend\View\Strategy\PhpRendererStrategy ::
injectResponse
Priority
1
Identifier
*
finish
Zend\Mvc\SendResponseListener ::
sendResponse
Priority
-10000
Identifier
*
Response Events
(Zend\Mvc\SendResponseListener)
sendResponse
Zend\Mvc\ResponseSender\PhpEnvironmentResponseSender ::
INVOKABLE
Priority
-1000
Identifier
*
Zend\Mvc\ResponseSender\ConsoleResponseSender ::
INVOKABLE
Priority
-2000
Identifier
*
Zend\Mvc\ResponseSender\SimpleStreamResponseSender ::
INVOKABLE
Priority
-3000
Identifier
*
Zend\Mvc\ResponseSender\HttpResponseSender ::
INVOKABLE
Priority
-4000
Identifier
*