Zend\MVC - The MvcEvent

14 important questions on Zend\MVC - The MvcEvent

What interface must be implemented to auto inject the MvcEvent?

Zend\Mvc\InjectApplicationEventInterface

Which 7 objects are hold by a MvcEvent?

1. Application
2. Request
3. Response
4. Router
5. RouteMatch
6. Result
7. ViewModel

What 7 MvcEvent's are triggered (in precise order)?

1. MvcEvent::EVENT_BOOTSTRAP
2. MvcEvent::EVENT_ROUTE
3. MvcEvent::EVENT_DISPATCH
4. MvcEvent::EVENT_DISPATCH_ERROR
5. MvcEvent::EVENT_RENDER
6. MvcEvent::EVENT_RENDER_ERROR
7. MvcEvent::EVENT_FINISH
  • Higher grades + faster learning
  • Never study anything twice
  • 100% sure, 100% understanding
Discover Study Smart

What are the 2 default listeners for MvcEvent::EVENT_ROUTE?

namespace Zend\Mvc;

1. ModuleRouteListener
2. RouteListener

What class triggers the MvcEvent::EVENT_ROUTE?

Zend\Mvc\Application

What are the 2 listeners for the MvcEvent::EVENT_DISPATCH (both http and console based)?

namespace Zend\Mvc;

1. DispatchListener::onDispatch()
2. AbstractController::onDispatch()

Which two classes trigger the MvcEvent::EVENT_BOOTSTRAP?

1. Zend\Mvc\Application::run()
2. Zend\Mvc\Controller\AbstractController::dispatch()

What is the listener for the MvcEvent::EVENT_DISPATCH_ERROR (both contexts)?

1. Zend\Mvc\DispatchListener::reportMonitorEvent()

What are the 2 listeners for the MvcEvent::EVENT_RENDER?

1. Zend\Mvc\View\Console\DefaultRenderingStrategy::render() (console)
2. Zend\Mvc\View\Http\DefaultRenderingStrategy::render() (http)

What is the trigger for the MvcEvent::EVENT_RENDER?

1. Zend\Mvc\Application::completeRequest()

What are the 2 listeners for the MvcEvent::EVENT_RENDER_ERROR? (console based)?

namespace Zend\Mvc\View\Console;

1. ExceptionStrategy::prepareExceptionViewModel()
2. InjectViewModelListener::injectViewModel()

What is the trigger for the MvcEvent::EVENT_RENDER_ERROR?

namespace Zend\Mvc\View\Http;

1. DefaultRenderingStrategy::render()

What is the listener for the MvcEvent::EVENT_FINISH?

1. Zend\Mvc\SendResponseListener::sendResponse()

What are the 3 triggers for the MvcEvent::EVENT_FINISH?

In Zend\Mvc\Application;

1. run() (after EVENT_ROUTE)
2. run() (after EVENT_DISPATCH)
3. completeRequest() (after  EVENT_RENDER)

The question on the page originate from the summary of the following study material:

  • A unique study and practice tool
  • Never study anything twice again
  • Get the grades you hope for
  • 100% sure, 100% understanding
Remember faster, study better. Scientifically proven.
Trustpilot Logo