‪TYPO3CMS  9.5
TYPO3\CMS\Extbase\Mvc\Controller\AbstractController Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Mvc\Controller\AbstractController:
TYPO3\CMS\Extbase\Mvc\Controller\ControllerInterface TYPO3\CMS\Extbase\Mvc\Controller\ActionController TYPO3\CMS\Extbase\Tests\Fixture\DummyController ExtbaseTeam\BlogExample\Controller\BlogController ExtbaseTeam\BlogExample\Controller\ContentController OliverHader\IrreTutorial\Controller\AbstractController TYPO3\CMS\Belog\Controller\BackendLogController TYPO3\CMS\Beuser\Controller\BackendUserController TYPO3\CMS\Beuser\Controller\BackendUserGroupController TYPO3\CMS\Beuser\Controller\PermissionController TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Controller\ArgumentTestController TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Controller\TestController TYPO3\CMS\Extbase\Tests\Functional\Validation\Fixture\Controller\TestController TYPO3\CMS\Extbase\Tests\Unit\Reflection\Fixture\DummyController TYPO3\CMS\Extbase\Tests\Unit\Reflection\Fixture\DummyControllerWithValidateAnnotationWithoutParam TYPO3\CMS\Extbase\Tests\Unit\Reflection\Fixture\DummyControllerWithValidateAnnotationWithoutParamTypeHint TYPO3\CMS\Extbase\Tests\UnitDeprecated\Reflection\Fixture\DummyControllerWithValidateAnnotations TYPO3\CMS\Extbase\Tests\UnitDeprecated\Reflection\Fixture\DummyControllerWithValidateAnnotationWithoutParam TYPO3\CMS\Extbase\Tests\UnitDeprecated\Reflection\Fixture\DummyControllerWithValidateAnnotationWithoutParamTypeHint TYPO3\CMS\Extensionmanager\Controller\AbstractController TYPO3\CMS\Filelist\Controller\FileListController TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetController TYPO3\CMS\Form\Controller\AbstractBackendController TYPO3\CMS\Form\Controller\FormFrontendController TYPO3\CMS\IndexedSearch\Controller\AdministrationController TYPO3\CMS\IndexedSearch\Controller\SearchController TYPO3\CMS\Workspaces\Controller\ReviewController TYPO3Fluid\FluidTest\Controller\TemplateController

Public Member Functions

 injectSignalSlotDispatcher (\TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher)
 
 injectValidatorResolver (\TYPO3\CMS\Extbase\Validation\ValidatorResolver $validatorResolver)
 
ControllerContext getControllerContext ()
 
 __construct ()
 
 injectConfigurationManager (ConfigurationManagerInterface $configurationManager)
 
 injectObjectManager (\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager)
 
 addFlashMessage ($messageBody, $messageTitle='', $severity=\TYPO3\CMS\Core\Messaging\AbstractMessage::OK, $storeInSession=true)
 
bool canProcessRequest (\TYPO3\CMS\Extbase\Mvc\RequestInterface $request)
 
 processRequest (\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response)
 
 forward ($actionName, $controllerName=null, $extensionName=null, array $arguments=null)
 
 throwStatus ($statusCode, $statusMessage=null, $content=null)
 
 initializeControllerArgumentsBaseValidators ()
 

Protected Member Functions

TYPO3 CMS Extbase Mvc Controller ControllerContext buildControllerContext ()
 
 redirect ($actionName, $controllerName=null, $extensionName=null, array $arguments=null, $pageUid=null, $delay=0, $statusCode=303)
 
 redirectToUri ($uri, $delay=0, $statusCode=303)
 
string addBaseUriIfNecessary ($uri)
 
 mapRequestArgumentsToControllerArguments ()
 

Protected Attributes

TYPO3 CMS Extbase SignalSlot Dispatcher $signalSlotDispatcher
 
TYPO3 CMS Extbase Object ObjectManagerInterface $objectManager
 
TYPO3 CMS Extbase Mvc Web Routing UriBuilder $uriBuilder
 
string $extensionName
 
array $settings
 
TYPO3 CMS Extbase Mvc RequestInterface $request
 
TYPO3 CMS Extbase Mvc ResponseInterface $response
 
TYPO3 CMS Extbase Validation ValidatorResolver $validatorResolver
 
TYPO3 CMS Extbase Mvc Controller Arguments $arguments
 
array $supportedRequestTypes = array( \TYPO3\CMS\Extbase\Mvc\Request::class )
 
TYPO3 CMS Extbase Mvc Controller ControllerContext $controllerContext
 
ConfigurationManagerInterface $configurationManager
 

Detailed Description

An abstract base class for Controllers

Definition at line 25 of file AbstractController.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::__construct ( )

Constructs the controller.

Definition at line 112 of file AbstractController.php.

Member Function Documentation

◆ addBaseUriIfNecessary()

string TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::addBaseUriIfNecessary (   $uri)
protected

Adds the base uri if not already in place.

Parameters
string$uri‪The URI
Returns
‪string

Definition at line 343 of file AbstractController.php.

Referenced by TYPO3\CMS\Extbase\Mvc\Controller\AbstractController\redirectToUri().

◆ addFlashMessage()

TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::addFlashMessage (   $messageBody,
  $messageTitle = '',
  $severity = \TYPO3\CMS\Core\Messaging\AbstractMessage::OK,
  $storeInSession = true 
)

◆ buildControllerContext()

◆ canProcessRequest()

bool TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::canProcessRequest ( \TYPO3\CMS\Extbase\Mvc\RequestInterface  $request)

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

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

Parameters
\TYPO3\CMS\Extbase\Mvc\RequestInterface$request‪The current request
Returns
‪bool TRUE if this request type is supported, otherwise FALSE

Implements TYPO3\CMS\Extbase\Mvc\Controller\ControllerInterface.

Definition at line 180 of file AbstractController.php.

References TYPO3\CMS\Extbase\Mvc\Controller\AbstractController\$request.

Referenced by TYPO3\CMS\Extbase\Mvc\Controller\ActionController\processRequest(), and TYPO3\CMS\Extbase\Mvc\Controller\AbstractController\processRequest().

◆ forward()

TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::forward (   $actionName,
  $controllerName = null,
  $extensionName = null,
array  $arguments = null 
)

Forwards the request to another action and / or controller.

Request is directly transferred to the other action / controller without the need for a new request.

Parameters
string$actionName‪Name of the action to forward to
string | null$controllerName‪Unqualified object name of the controller to forward to. If not specified, the current controller is used.
string | null$extensionName‪Name of the extension containing the controller to forward to. If not specified, the current extension is assumed.
array | null$argumentsArguments to pass to the target action
Exceptions
StopActionException
See also
redirect()

Definition at line 247 of file AbstractController.php.

References TYPO3\CMS\Extbase\Mvc\Controller\AbstractController\$arguments, and TYPO3\CMS\Extbase\Mvc\Controller\AbstractController\$extensionName.

Referenced by TYPO3\CMS\Beuser\Controller\BackendUserController\addToCompareListAction(), TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Controller\ArgumentTestController\forwardAction(), TYPO3\CMS\Extbase\Mvc\Controller\ActionController\forwardToReferringRequest(), OliverHader\IrreTutorial\Controller\QueueController\indexAction(), TYPO3\CMS\Filelist\Controller\FileListController\indexAction(), TYPO3\CMS\Extensionmanager\Controller\DownloadController\installDistributionAction(), TYPO3\CMS\Extensionmanager\Controller\ActionController\installExtensionWithoutSystemDependencyCheckAction(), TYPO3\CMS\Extensionmanager\Controller\DownloadController\installExtensionWithoutSystemDependencyCheckAction(), TYPO3\CMS\Form\Controller\FormFrontendController\performAction(), OliverHader\IrreTutorial\Controller\AbstractController\process(), OliverHader\IrreTutorial\Controller\QueueController\processAction(), TYPO3\CMS\Beuser\Controller\BackendUserController\removeFromCompareListAction(), TYPO3\CMS\Filelist\Controller\FileListController\searchAction(), TYPO3\CMS\Beuser\Controller\BackendUserController\terminateBackendUserSessionAction(), and ExtbaseTeam\BlogExample\Controller\BlogController\testForwardAction().

◆ getControllerContext()

ControllerContext TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::getControllerContext ( )

◆ initializeControllerArgumentsBaseValidators()

TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::initializeControllerArgumentsBaseValidators ( )

Collects the base validators which were defined for the data type of each controller argument and adds them to the argument's validator chain.

Definition at line 378 of file AbstractController.php.

References $validator.

Referenced by TYPO3\CMS\Extbase\Mvc\Controller\AbstractController\processRequest().

◆ injectConfigurationManager()

TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::injectConfigurationManager ( ConfigurationManagerInterface  $configurationManager)

◆ injectObjectManager()

TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::injectObjectManager ( \TYPO3\CMS\Extbase\Object\ObjectManagerInterface  $objectManager)

Injects the object manager

Parameters
\TYPO3\CMS\Extbase\Object\ObjectManagerInterface$objectManager

Definition at line 138 of file AbstractController.php.

References TYPO3\CMS\Extbase\Mvc\Controller\AbstractController\$objectManager, and TYPO3\CMS\Extbase\Object\ObjectManagerInterface\get().

◆ injectSignalSlotDispatcher()

TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::injectSignalSlotDispatcher ( \TYPO3\CMS\Extbase\SignalSlot\Dispatcher  $signalSlotDispatcher)
Parameters
\TYPO3\CMS\Extbase\SignalSlot\Dispatcher$signalSlotDispatcher

Definition at line 72 of file AbstractController.php.

References TYPO3\CMS\Extbase\Mvc\Controller\AbstractController\$signalSlotDispatcher.

◆ injectValidatorResolver()

TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::injectValidatorResolver ( \TYPO3\CMS\Extbase\Validation\ValidatorResolver  $validatorResolver)
Parameters
\TYPO3\CMS\Extbase\Validation\ValidatorResolver$validatorResolver

Definition at line 80 of file AbstractController.php.

References TYPO3\CMS\Extbase\Mvc\Controller\AbstractController\$validatorResolver.

◆ mapRequestArgumentsToControllerArguments()

TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::mapRequestArgumentsToControllerArguments ( )
protected

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

Exceptions
Exception

Definition at line 394 of file AbstractController.php.

Referenced by TYPO3\CMS\Extbase\Mvc\Controller\ActionController\processRequest(), and TYPO3\CMS\Extbase\Mvc\Controller\AbstractController\processRequest().

◆ processRequest()

TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::processRequest ( \TYPO3\CMS\Extbase\Mvc\RequestInterface  $request,
\TYPO3\CMS\Extbase\Mvc\ResponseInterface  $response 
)

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

Parameters
\TYPO3\CMS\Extbase\Mvc\RequestInterface$request‪The request object
\TYPO3\CMS\Extbase\Mvc\ResponseInterface$response‪The response, modified by this handler
Exceptions
UnsupportedRequestTypeException‪if the controller doesn't support the current request type

Implements TYPO3\CMS\Extbase\Mvc\Controller\ControllerInterface.

Reimplemented in TYPO3\CMS\Extbase\Mvc\Controller\ActionController.

Definition at line 197 of file AbstractController.php.

References TYPO3\CMS\Extbase\Mvc\Controller\AbstractController\$request, TYPO3\CMS\Extbase\Mvc\Controller\AbstractController\$response, TYPO3\CMS\Extbase\Mvc\Controller\AbstractController\buildControllerContext(), TYPO3\CMS\Extbase\Mvc\Controller\AbstractController\canProcessRequest(), TYPO3\CMS\Extbase\Mvc\Controller\AbstractController\initializeControllerArgumentsBaseValidators(), TYPO3\CMS\Extbase\Mvc\Controller\AbstractController\mapRequestArgumentsToControllerArguments(), and TYPO3\CMS\Extbase\Mvc\RequestInterface\setDispatched().

◆ redirect()

TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::redirect (   $actionName,
  $controllerName = null,
  $extensionName = null,
array  $arguments = null,
  $pageUid = null,
  $delay = 0,
  $statusCode = 303 
)
protected

Redirects the request to another action and / or controller.

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 thrown an exception if used with other request types.

Parameters
string$actionName‪Name of the action to forward to
string | null$controllerName‪Unqualified object name of the controller to forward to. If not specified, the current controller is used.
string | null$extensionName‪Name of the extension containing the controller to forward to. If not specified, the current extension is assumed.
array | null$argumentsArguments to pass to the target action
int | null$pageUid‪Target page uid. If NULL, the current page uid is used
int$delay‪(optional) The delay in seconds. Default is no delay.
int$statusCode‪(optional) The HTTP status code for the redirect. Default is "303 See Other
Exceptions
UnsupportedRequestTypeException‪If the request is not a web request
StopActionException
See also
forward()

Definition at line 284 of file AbstractController.php.

References TYPO3\CMS\Extbase\Mvc\Controller\AbstractController\$arguments, TYPO3\CMS\Extbase\Mvc\Controller\AbstractController\$extensionName, and TYPO3\CMS\Extbase\Mvc\Controller\AbstractController\redirectToUri().

Referenced by TYPO3\CMS\Beuser\Controller\BackendUserController\compareAction(), OliverHader\IrreTutorial\Controller\ContentController\createAction(), OliverHader\IrreTutorial\Controller\ContentController\deleteAction(), TYPO3\CMS\Form\Controller\FormManagerController\deleteAction(), TYPO3\CMS\IndexedSearch\Controller\AdministrationController\deleteIndexedItemAction(), TYPO3\CMS\Belog\Controller\BackendLogController\deleteMessageAction(), TYPO3\CMS\Extensionmanager\Controller\UploadExtensionFileController\extractAction(), TYPO3\CMS\Workspaces\Controller\ReviewController\indexAction(), TYPO3\CMS\IndexedSearch\Controller\SearchController\initialize(), TYPO3\CMS\Extensionmanager\Controller\DownloadController\installDistributionAction(), TYPO3\CMS\Extensionmanager\Controller\ActionController\reloadExtensionDataAction(), TYPO3\CMS\IndexedSearch\Controller\AdministrationController\saveStopwordsKeywordsAction(), TYPO3\CMS\IndexedSearch\Controller\AdministrationController\statisticDetailsAction(), TYPO3\CMS\Extensionmanager\Controller\ActionController\toggleExtensionInstallationStateAction(), and OliverHader\IrreTutorial\Controller\ContentController\updateAction().

◆ redirectToUri()

TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::redirectToUri (   $uri,
  $delay = 0,
  $statusCode = 303 
)
protected

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
mixed$uri‪A string representation of a URI
int$delay‪(optional) The delay in seconds. Default is no delay.
int$statusCode‪(optional) The HTTP status code for the redirect. Default is "303 See Other
Exceptions
UnsupportedRequestTypeException‪If the request is not a web request
StopActionException

Definition at line 311 of file AbstractController.php.

References TYPO3\CMS\Extbase\Mvc\Controller\AbstractController\addBaseUriIfNecessary().

Referenced by TYPO3\CMS\Extbase\Mvc\Controller\AbstractController\redirect(), and TYPO3\CMS\Beuser\Controller\PermissionController\updateAction().

◆ throwStatus()

TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::throwStatus (   $statusCode,
  $statusMessage = null,
  $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
int$statusCode‪The HTTP status code
string$statusMessage‪A custom HTTP status message
string$content‪Body content which further explains the status
Exceptions
UnsupportedRequestTypeException‪If the request is not a web request
StopActionException

Definition at line 359 of file AbstractController.php.

Member Data Documentation

◆ $arguments

◆ $configurationManager

ConfigurationManagerInterface TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::$configurationManager
protected

◆ $controllerContext

TYPO3 CMS Extbase Mvc Controller ControllerContext TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::$controllerContext
protected

◆ $extensionName

◆ $objectManager

TYPO3 CMS Extbase Object ObjectManagerInterface TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::$objectManager
protected

◆ $request

TYPO3 CMS Extbase Mvc RequestInterface TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::$request
protected

◆ $response

TYPO3 CMS Extbase Mvc ResponseInterface TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::$response
protected

The response which will be returned by this action controller

Definition at line 59 of file AbstractController.php.

Referenced by TYPO3\CMS\Extbase\Mvc\Controller\AbstractController\processRequest().

◆ $settings

array TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::$settings
protected

Contains the settings of the current extension

Definition at line 47 of file AbstractController.php.

◆ $signalSlotDispatcher

TYPO3 CMS Extbase SignalSlot Dispatcher TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::$signalSlotDispatcher
protected

◆ $supportedRequestTypes

array TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::$supportedRequestTypes = array( \TYPO3\CMS\Extbase\Mvc\Request::class )
protected

An array of supported request types. By default only web requests are supported. Modify or replace this array if your specific controller supports certain (additional) request types.

Definition at line 91 of file AbstractController.php.

◆ $uriBuilder

◆ $validatorResolver

TYPO3 CMS Extbase Validation ValidatorResolver TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::$validatorResolver
protected