Extbase\MVC\Controller

Class Tx_Extbase_MVC_Controller_AbstractController

All Implemented Interfaces:

Direct Known Subclasses:


public class Tx_Extbase_MVC_Controller_AbstractController
implements Tx_Extbase_MVC_Controller_ControllerInterface

An abstract base class for Controllers

Package: Extbase
Subpackage: MVC\Controller
Version: $ID:$


Field Summary

protected array $settings
protected $request
protected $response
protected $argumentsMappingResults

Method Summary

 boolean canProcessRequest($request)
 void processRequest($request, $response)
 protected Tx_Extbase_MVC_Controller_ControllerContext buildControllerContext()
 void forward(string $actionName, string $controllerName=NULL, string $extensionName=NULL, array $arguments=NULL)
 protected void redirect(string $actionName, string $controllerName=NULL, string $extensionName=NULL, array $arguments=NULL, integer $pageUid=NULL, int $delay=0, int $statusCode=303)
 protected void redirectToURI(mixed $uri, int $delay=0, int $statusCode=303)
 void throwStatus(integer $statusCode, string $statusMessage=NULL, string $content=NULL)

Field Detail

$settings

protected array $settings

Contains the settings of the current extension


$request

protected $request

The current request.


$response

protected $response

The response which will be returned by this action controller


$argumentsMappingResults

protected $argumentsMappingResults

The results of the mapping of request arguments to controller arguments


Method Detail

canProcessRequest

public boolean canProcessRequest($request)

Checks if the current request type is supported by the controller.

If your controller only supports certain request types, either replace / modify the supporteRequestTypes property or override this method.

Description Copied From interface:

Checks if the current request type is supported by the controller.

Specified By

Parameters

$request - The current request

processRequest

public void processRequest($request, $response)

Processes a general request. The result can be returned by altering the given response.

Description Copied From interface:

Processes a general request. The result can be returned by altering the given response.

Specified By

Parameters

$request - The request object
$response - The response, modified by this handler

buildControllerContext

protected Tx_Extbase_MVC_Controller_ControllerContext buildControllerContext()

Initialize the controller context

forward

public void forward(string $actionName, string $controllerName=NULL, string $extensionName=NULL, array $arguments=NULL)

Forwards the request to another controller.

Parameters

$actionName - Name of the action to forward to
$controllerName - Unqualified object name of the controller to forward to. If not specified, the current controller is used.
$extensionName - Name of the extension containing the controller to forward to. If not specified, the current extension is assumed.
$arguments - Arguments to pass to the target action

redirect

protected void redirect(string $actionName, string $controllerName=NULL, string $extensionName=NULL, array $arguments=NULL, integer $pageUid=NULL, int $delay=0, int $statusCode=303)

Forwards the request to another action and / or controller.

NOTE: This method only supports web requests and will thrown an exception if used with other request types.

Parameters

$actionName - Name of the action to forward to
$controllerName - Unqualified object name of the controller to forward to. If not specified, the current controller is used.
$extensionName - Name of the extension containing the controller to forward to. If not specified, the current extension is assumed.
$arguments - Arguments to pass to the target action
$pageUid - Target page uid. If NULL, the current page uid is used
$delay - (optional) The delay in seconds. Default is no delay.
$statusCode - (optional) The HTTP status code for the redirect. Default is "303 See Other"

redirectToURI

protected void redirectToURI(mixed $uri, int $delay=0, int $statusCode=303)

Redirects the web request to another uri.

NOTE: This method only supports web requests and will thrown an exception if used with other request types.

Parameters

$uri - A string representation of a URI
$delay - (optional) The delay in seconds. Default is no delay.
$statusCode - (optional) The HTTP status code for the redirect. Default is "303 See Other"

throwStatus

public void throwStatus(integer $statusCode, string $statusMessage=NULL, string $content=NULL)

Sends the specified HTTP status immediately.

NOTE: This method only supports web requests and will thrown an exception if used with other request types.

Parameters

$statusCode - The HTTP status code
$statusMessage - A custom HTTP status message
$content - Body content which further explains the status