PHP Класс 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.
Наследование: implements Zend\EventManager\ListenerAggregateInterface
Показать файл Открыть проект

Открытые методы

Метод Описание
__construct ( ControllerManager $controllerManager )
attach ( Zend\EventManager\EventManagerInterface $events, integer $priority = 1 ) : void Attach listeners to an event manager
onDispatch ( MvcEvent $e ) : mixed Listen to the "dispatch" event
reportMonitorEvent ( MvcEvent $e )

Защищенные методы

Метод Описание
complete ( mixed $return, MvcEvent $event ) : mixed Complete the dispatch
marshalBadControllerEvent ( string $controllerName, MvcEvent $event, Application $application, Throwable | Exception $exception ) : mixed Marshal a bad controller exception event
marshalControllerNotFoundEvent ( string $type, string $controllerName, MvcEvent $event, Application $application, Throwable | Exception $exception = null ) : mixed Marshal a controller not found exception event

Описание методов

__construct() публичный Метод

public __construct ( ControllerManager $controllerManager )
$controllerManager Zend\Mvc\Controller\ControllerManager

attach() публичный Метод

Attach listeners to an event manager
public attach ( Zend\EventManager\EventManagerInterface $events, integer $priority = 1 ) : void
$events Zend\EventManager\EventManagerInterface
$priority integer
Результат void

complete() защищенный Метод

Complete the dispatch
protected complete ( mixed $return, MvcEvent $event ) : mixed
$return mixed
$event MvcEvent
Результат mixed

marshalBadControllerEvent() защищенный Метод

Marshal a bad controller exception event
protected marshalBadControllerEvent ( string $controllerName, MvcEvent $event, Application $application, Throwable | Exception $exception ) : mixed
$controllerName string
$event MvcEvent
$application Application
$exception Throwable | Exception
Результат mixed

marshalControllerNotFoundEvent() защищенный Метод

Marshal a controller not found exception event
protected marshalControllerNotFoundEvent ( string $type, string $controllerName, MvcEvent $event, Application $application, Throwable | Exception $exception = null ) : mixed
$type string
$controllerName string
$event MvcEvent
$application Application
$exception Throwable | Exception
Результат mixed

onDispatch() публичный Метод

Listen to the "dispatch" event
public onDispatch ( MvcEvent $e ) : mixed
$e MvcEvent
Результат mixed

reportMonitorEvent() публичный Метод

public reportMonitorEvent ( MvcEvent $e )
$e MvcEvent