HttpDispatcher

Implements \HttpDispatcherInterface

Class HttpDispatcher

category

System

package

Http

implements

HttpDispatcherInterface

Methods

Initializes the http dispatcher.

__construct(\HttpContextReaderInterface $httpContextReader, \HttpViewControllerFactoryInterface $httpViewControllerFactory) 
Throws
\MissingControllerNameException

If no controller is found.

Arguments

$httpContextReader

\HttpContextReaderInterface

$httpViewControllerFactory

\HttpViewControllerFactoryInterface

Dispatches the current http request.

dispatch(\HttpContextInterface $httpContext) 

If the http request is valid and can get handled by a controller class, the controllers ::proceed method is invoked by the dispatcher. Otherwise, the method will throw a missing controller name exception.

Throws
\MissingControllerNameException

When the http request context is invalid.

Arguments

$httpContext

\HttpContextInterface

Object which holds information about the current http context.

Properties

httpContextReader

httpContextReader : \HttpContextReaderInterface

httpViewControllerFactory

httpViewControllerFactory : \HttpViewControllerFactoryInterface