HttpViewControllerFactory

Implements \HttpViewControllerFactoryInterface

Class HttpViewControllerFactory

category

System

package

Http

subpackage

Factories

implements

HttpViewControllerFactoryInterface

Methods

Initialize the http view controller factory.

__construct(\HttpViewControllerRegistryInterface $httpViewControllerRegistry, \HttpContextReaderInterface $httpContextReader, \HttpResponseProcessorInterface $httpResponseProcessor) 

Arguments

$httpViewControllerRegistry

\HttpViewControllerRegistryInterface

Object which holds the registered controller class names.

$httpContextReader

\HttpContextReaderInterface

Object to read the http context.

$httpResponseProcessor

\HttpResponseProcessorInterface

Object to process the http response.

Creates and returns the content view for a http view controller by the controller name.

_createControllerContentView(string $controllerName) : \ContentViewInterface
Throws
\LogicException

When the content view does not implement the content view interface.

Arguments

$controllerName

string

Name of the http controller class.

Response

\ContentViewInterface

Content view instance for the http view controller.

Returns the class name of a http controller by the given controller name.

_getControllerClassName(string $controllerName) : string
Throws
\LogicException

When the found controller class does not implement the http view controller interface.

Arguments

$controllerName

string

Name of the http controller class.

Response

string

Class name of the http controller.

Creates a new instance of a http view controller by the given controller name.

createController(string $controllerName) : \HttpViewControllerInterface
Throws
\LogicException

If the controller is not registered in the http view controller registry or the controller does not implement the http view controller interface.

Arguments

$controllerName

string

Expected name of controller (without 'Controller'-Suffix)

Response

\HttpViewControllerInterface

Created controller instance.

Properties

httpViewControllerRegistry

httpViewControllerRegistry : \HttpViewControllerRegistryInterface

httpContextReader

httpContextReader : \HttpContextReaderInterface

httpResponseProcessor

httpResponseProcessor : \HttpResponseProcessorInterface