PHP Class Neos\Flow\Mvc\Controller\AbstractController

Inheritance: implements Neos\Flow\Mvc\Controller\ControllerInterface
Exibir arquivo Open project: neos/flow-development-collection

Protected Properties

Property Type Description
$arguments Arguments Arguments passed to the controller
$controllerContext ControllerContext
$flashMessageContainer Neos\Flow\Mvc\FlashMessageContainer ..) to add a new Flash Message.
$persistenceManager Neos\Flow\Persistence\PersistenceManagerInterface
$request Neos\Flow\Mvc\ActionRequest The current action request directed to this controller
$response Neos\Flow\Http\Response The response which will be returned by this action controller
$supportedMediaTypes array A list of IANA media types which are supported by this controller
$uriBuilder Neos\Flow\Mvc\Routing\UriBuilder
$validatorResolver Neos\Flow\Validation\ValidatorResolver

Public Methods

Method Description
addFlashMessage ( string $messageBody, string $messageTitle = '', string $severity = Error\Message::SEVERITY_OK, array $messageArguments = [], integer $messageCode = null ) : void Creates a Message object and adds it to the FlashMessageContainer.
getControllerContext ( ) : ControllerContext Returns this controller's context.

Protected Methods

Method Description
forward ( string $actionName, string $controllerName = null, string $packageKey = null, array $arguments = [] ) : void Forwards the request to another action and / or controller.
forwardToRequest ( ActionRequest $request ) : void Forwards the request to another action and / or controller.
initializeController ( Neos\Flow\Mvc\RequestInterface $request, Neos\Flow\Mvc\ResponseInterface $response ) Initializes the controller
mapRequestArgumentsToControllerArguments ( ) : void Maps arguments delivered by the request object to the local controller arguments.
redirect ( string $actionName, string $controllerName = null, string $packageKey = null, array $arguments = null, integer $delay, integer $statusCode = 303, string $format = null ) : void Redirects the request to another action and / or controller.
redirectToRequest ( ActionRequest $request, integer $delay, integer $statusCode = 303 ) : void Redirects the request to another action and / or controller.
redirectToUri ( mixed $uri, integer $delay, integer $statusCode = 303 ) Redirects to another URI
throwStatus ( integer $statusCode, string $statusMessage = null, string $content = null ) Sends the specified HTTP status immediately.

Method Details

addFlashMessage() public method

This method should be used to add FlashMessages rather than interacting with the container directly.
See also: Error\Message
public addFlashMessage ( string $messageBody, string $messageTitle = '', string $severity = Error\Message::SEVERITY_OK, array $messageArguments = [], integer $messageCode = null ) : void
$messageBody string text of the FlashMessage
$messageTitle string optional header of the FlashMessage
$severity string severity of the FlashMessage (one of the Message::SEVERITY_* constants)
$messageArguments array arguments to be passed to the FlashMessage
$messageCode integer
return void

forward() protected method

Request is directly transferred to the other action / controller
See also: redirect()
protected forward ( string $actionName, string $controllerName = null, string $packageKey = null, array $arguments = [] ) : void
$actionName string Name of the action to forward to
$controllerName string Unqualified object name of the controller to forward to. If not specified, the current controller is used.
$packageKey string Key of the package containing the controller to forward to. May also contain the sub package, concatenated with backslash (Vendor.Foo\Bar\Baz). If not specified, the current package is assumed.
$arguments array Arguments to pass to the target action
return void

forwardToRequest() protected method

Request is directly transfered to the other action / controller
See also: redirectToRequest()
protected forwardToRequest ( ActionRequest $request ) : void
$request Neos\Flow\Mvc\ActionRequest The request to redirect to
return void

getControllerContext() public method

Note that the context is only available after processRequest() has been called.
public getControllerContext ( ) : ControllerContext
return ControllerContext The current controller context

initializeController() protected method

This method should be called by the concrete processRequest() method.
protected initializeController ( Neos\Flow\Mvc\RequestInterface $request, Neos\Flow\Mvc\ResponseInterface $response )
$request Neos\Flow\Mvc\RequestInterface
$response Neos\Flow\Mvc\ResponseInterface

mapRequestArgumentsToControllerArguments() protected method

Maps arguments delivered by the request object to the local controller arguments.

redirect() protected method

Redirect will be sent to the client which then performs another request to the new URI. NOTE: This method only supports web requests and will throw an exception if used with other request types.
See also: forward()
protected redirect ( string $actionName, string $controllerName = null, string $packageKey = null, array $arguments = null, integer $delay, integer $statusCode = 303, string $format = null ) : void
$actionName string Name of the action to forward to
$controllerName string Unqualified object name of the controller to forward to. If not specified, the current controller is used.
$packageKey string Key of the package containing the controller to forward to. If not specified, the current package is assumed.
$arguments array Array of arguments for the target action
$delay integer (optional) The delay in seconds. Default is no delay.
$statusCode integer (optional) The HTTP status code for the redirect. Default is "303 See Other"
$format string The format to use for the redirect URI
return void

redirectToRequest() protected method

Redirect will be sent to the client which then performs another request to the new URI. NOTE: This method only supports web requests and will throw an exception if used with other request types.
See also: forwardToRequest()
protected redirectToRequest ( ActionRequest $request, integer $delay, integer $statusCode = 303 ) : void
$request Neos\Flow\Mvc\ActionRequest The request to redirect to
$delay integer (optional) The delay in seconds. Default is no delay.
$statusCode integer (optional) The HTTP status code for the redirect. Default is "303 See Other"
return void

redirectToUri() protected method

Redirects to another URI
protected redirectToUri ( mixed $uri, integer $delay, integer $statusCode = 303 )
$uri mixed Either a string representation of a URI or a \Neos\Flow\Http\Uri object
$delay integer (optional) The delay in seconds. Default is no delay.
$statusCode integer (optional) The HTTP status code for the redirect. Default is "303 See Other"

throwStatus() protected method

NOTE: This method only supports web requests and will throw an exception if used with other request types.
protected throwStatus ( integer $statusCode, string $statusMessage = null, string $content = null )
$statusCode integer The HTTP status code
$statusMessage string A custom HTTP status message
$content string Body content which further explains the status

Property Details

$arguments protected_oe property

Arguments passed to the controller
protected Arguments,Neos\Flow\Mvc\Controller $arguments
return Arguments

$controllerContext protected_oe property

protected ControllerContext,Neos\Flow\Mvc\Controller $controllerContext
return ControllerContext

$flashMessageContainer protected_oe property

..) to add a new Flash Message.
protected FlashMessageContainer,Neos\Flow\Mvc $flashMessageContainer
return Neos\Flow\Mvc\FlashMessageContainer

$persistenceManager protected_oe property

protected PersistenceManagerInterface,Neos\Flow\Persistence $persistenceManager
return Neos\Flow\Persistence\PersistenceManagerInterface

$request protected_oe property

The current action request directed to this controller
protected ActionRequest,Neos\Flow\Mvc $request
return Neos\Flow\Mvc\ActionRequest

$response protected_oe property

The response which will be returned by this action controller
protected Response,Neos\Flow\Http $response
return Neos\Flow\Http\Response

$supportedMediaTypes protected_oe property

A list of IANA media types which are supported by this controller
See also: http://www.iana.org/assignments/media-types/index.html
protected array $supportedMediaTypes
return array

$uriBuilder protected_oe property

protected UriBuilder,Neos\Flow\Mvc\Routing $uriBuilder
return Neos\Flow\Mvc\Routing\UriBuilder

$validatorResolver protected_oe property

protected ValidatorResolver,Neos\Flow\Validation $validatorResolver
return Neos\Flow\Validation\ValidatorResolver