PHP Class Zend\Mvc\DispatchListener
Pulls controllers from the service manager's "ControllerLoader" service.
If the controller cannot be found, or is not dispatchable, sets up a "404"
result.
If the controller subscribes to InjectApplicationEventInterface, it injects
the current MvcEvent into the controller.
It then calls the controller's "dispatch" method, passing it the request and
response. If an exception occurs, it triggers the "dispatch.error" event,
in an attempt to return a 500 status.
The return value of dispatching the controller is placed into the result
property of the MvcEvent, and returned.
Mostra file
Open project: zendframework/zend-mvc
Public Methods
Protected Methods
Method Details
__construct()
public method
public __construct ( ControllerManager $controllerManager ) |
$controllerManager |
Zend\Mvc\Controller\ControllerManager |
|
Attach listeners to an event manager
public attach ( Zend\EventManager\EventManagerInterface $events, integer $priority = 1 ) : void |
$events |
Zend\EventManager\EventManagerInterface |
|
$priority |
integer |
|
return |
void |
|
complete()
protected method
marshalBadControllerEvent()
protected method
Marshal a bad controller exception event
marshalControllerNotFoundEvent()
protected method
Marshal a controller not found exception event
onDispatch()
public method
Listen to the "dispatch" event
reportMonitorEvent()
public method