interface ControllerInterface (View source)

Generic interface for controllers

This interface serves as a common contract for all kinds of controllers. That is, in Flow it covers typical ActionController scenarios. They deal with an incoming request and provide a response.

Controllers implementing this interface are compatible with the MVC Dispatcher.

Methods

ResponseInterface
processRequest(ActionRequest $request)

Processes a general request.

Details

ResponseInterface processRequest(ActionRequest $request)

Processes a general request.

The contract to the MVC Dispatcher is as follows.

  • The response should be returned directly.

  • For outer ordinary control flow a {\Neos\Flow\Mvc\Exception\StopActionException} with response attached can be thrown which will be handled by the Dispatcher accordingly.

  • To forward the request to another controller, a {\Neos\Flow\Mvc\Exception\ForwardException} might be thrown which the Dispatcher will catch and handle its attached next-request.

Parameters

ActionRequest $request

The dispatched action request

Return Value

ResponseInterface

The resulting created response

Exceptions

StopActionException
ForwardException