class ControllerContext (View source)

The controller context holds information about the request, response, arguments and further details of a controller. Instances of this class act as a container for conveniently passing the information to other classes who need it, usually views being views or view helpers.

Properties

protected ActionRequest $request
protected ActionResponse $response
protected Arguments $arguments
protected UriBuilder $uriBuilder
protected FlashMessageService $flashMessageService

Methods

__construct(ActionRequest $request, ActionResponse $response, Arguments $arguments, UriBuilder $uriBuilder)

Constructs this context

getRequest()

Get the request of the controller

getResponse()

Get the response of the controller

getArguments()

Get the arguments of the controller

getUriBuilder()

Returns the URI Builder bound to this context

getFlashMessageContainer()

Get the flash message container

Details

__construct(ActionRequest $request, ActionResponse $response, Arguments $arguments, UriBuilder $uriBuilder)

Constructs this context

Parameters

ActionRequest $request
ActionResponse $response
Arguments $arguments
UriBuilder $uriBuilder

ActionRequest getRequest()

Get the request of the controller

Return Value

ActionRequest

ActionResponse getResponse()

Get the response of the controller

Return Value

ActionResponse

Arguments getArguments()

Get the arguments of the controller

Return Value

Arguments

UriBuilder getUriBuilder()

Returns the URI Builder bound to this context

Return Value

UriBuilder

FlashMessageContainer getFlashMessageContainer()

Get the flash message container

Return Value

FlashMessageContainer

A container for flash messages