TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Extbase\Mvc\Controller\AbstractController Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Mvc\Controller\AbstractController:
TYPO3\CMS\Extbase\Mvc\Controller\ControllerInterface Tx_Extbase_MVC_Controller_AbstractController TYPO3\CMS\Extbase\Mvc\Controller\ActionController OliverHader\IrreTutorial\Controller\AbstractController Tx_Extbase_MVC_Controller_ActionController TYPO3\CMS\About\Controller\AboutController TYPO3\CMS\Aboutmodules\Controller\ModulesController TYPO3\CMS\Belog\Controller\AbstractController TYPO3\CMS\Beuser\Controller\BackendUserController TYPO3\CMS\Documentation\Controller\DocumentController TYPO3\CMS\Extensionmanager\Controller\AbstractController TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetController TYPO3\CMS\IndexedSearch\Controller\SearchController TYPO3\CMS\Install\Controller\BackendModuleController TYPO3\CMS\Lang\Controller\LanguageController TYPO3\CMS\Reports\Controller\ReportController TYPO3\CMS\SysNote\Controller\NoteController TYPO3\CMS\Viewpage\Controller\ViewModuleController TYPO3\CMS\Workspaces\Controller\AbstractController

Public Member Functions

 getControllerContext ()
 
 __construct ()
 
 injectConfigurationManager (\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager)
 
 injectObjectManager (\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager)
 
 injectFlashMessageContainer (\TYPO3\CMS\Extbase\Mvc\Controller\FlashMessageContainer $flashMessageContainer)
 
 addFlashMessage ($messageBody, $messageTitle='', $severity=\TYPO3\CMS\Core\Messaging\AbstractMessage::OK, $storeInSession=TRUE)
 
 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

 redirect ($actionName, $controllerName=NULL, $extensionName=NULL, array $arguments=NULL, $pageUid=NULL, $delay=0, $statusCode=303)
 
 redirectToUri ($uri, $delay=0, $statusCode=303)
 
 addBaseUriIfNecessary ($uri)
 

Protected Attributes

 $signalSlotDispatcher
 
 $objectManager
 
 $uriBuilder
 
 $extensionName
 
 $settings
 
 $request
 
 $response
 
 $deprecatedPropertyMapper
 
 $validatorResolver
 
 $arguments
 
 $argumentsMappingResults
 
 $supportedRequestTypes = array('TYPO3\\CMS\\Extbase\\Mvc\\Request')
 
 $controllerContext
 
 $flashMessageContainer
 
 $configurationManager
 

Detailed Description

This file is part of the TYPO3 CMS project.

It is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, either version 2 of the License, or any later version.

For the full copyright and license information, please read the LICENSE.txt file that was distributed with this source code.

The TYPO3 project - inspiring people to share! An abstract base class for Controllers

Definition at line 21 of file AbstractController.php.

Constructor & Destructor Documentation

◆ __construct()

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

Constructs the controller.

Definition at line 132 of file AbstractController.php.

Member Function Documentation

◆ addBaseUriIfNecessary()

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

Adds the base uri if not already in place.

Parameters
string$uriThe URI
Returns
string

Definition at line 369 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 
)

Creates a Message object and adds it to the FlashMessageQueue.

Parameters
string$messageBodyThe message
string$messageTitleOptional message title
integer$severityOptional severity, must be one of constants
boolean$storeInSessionOptional, defines whether the message should be stored in the session (default) or not
Returns
void
Exceptions

Definition at line 192 of file AbstractController.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

Referenced by TYPO3\CMS\Extensionmanager\Controller\UploadExtensionFileController\extractAction(), TYPO3\CMS\Extensionmanager\Controller\DownloadController\installDistributionAction(), TYPO3\CMS\Extensionmanager\Controller\ActionController\removeExtensionAction(), TYPO3\CMS\Extensionmanager\Controller\ListController\terAction(), TYPO3\CMS\Extensionmanager\Controller\ActionController\toggleExtensionInstallationStateAction(), and TYPO3\CMS\Extensionmanager\Controller\DownloadController\updateExtensionAction().

◆ canProcessRequest()

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 supporteRequestTypes property or override this method.

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

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

Definition at line 214 of file AbstractController.php.

Referenced by 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 transfered to the other action / controller without the need for a new request.

Parameters
string$actionNameName of the action to forward to
string$controllerNameUnqualified object name of the controller to forward to. If not specified, the current controller is used.
string$extensionNameName of the extension containing the controller to forward to. If not specified, the current extension is assumed.
array$argumentsArguments to pass to the target action
Returns
void
Exceptions

Definition at line 285 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\Install\Controller\BackendModuleController\enableInstallToolAction(), TYPO3\CMS\Extbase\Mvc\Controller\ActionController\errorAction(), OliverHader\IrreTutorial\Controller\QueueController\indexAction(), TYPO3\CMS\Install\Controller\BackendModuleController\indexAction(), TYPO3\CMS\Extensionmanager\Controller\DownloadController\installDistributionAction(), TYPO3\CMS\Extensionmanager\Controller\ActionController\installExtensionWithoutSystemDependencyCheckAction(), TYPO3\CMS\Extensionmanager\Controller\DownloadController\installExtensionWithoutSystemDependencyCheckAction(), OliverHader\IrreTutorial\Controller\AbstractController\process(), OliverHader\IrreTutorial\Controller\QueueController\processAction(), TYPO3\CMS\Beuser\Controller\BackendUserController\removeFromCompareListAction(), and TYPO3\CMS\Beuser\Controller\BackendUserController\terminateBackendUserSessionAction().

◆ getControllerContext()

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.

Returns
void

Definition at line 403 of file AbstractController.php.

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

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

◆ injectConfigurationManager()

TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::injectConfigurationManager ( \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface  $configurationManager)
Parameters
\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface$configurationManager
Returns
void

Definition at line 151 of file AbstractController.php.

References TYPO3\CMS\Extbase\Mvc\Controller\AbstractController\$configurationManager, and TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface\CONFIGURATION_TYPE_SETTINGS.

◆ injectFlashMessageContainer()

TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::injectFlashMessageContainer ( \TYPO3\CMS\Extbase\Mvc\Controller\FlashMessageContainer  $flashMessageContainer)

This method is deprecated! For further information have a look at the PhpDoc of class

Parameters
\TYPO3\CMS\Extbase\Mvc\Controller\FlashMessageContainer$flashMessageContainer
Returns
void
Deprecated:
since Extbase 6.1, will be removed 2 versions later

Definition at line 176 of file AbstractController.php.

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

◆ 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
Returns
void

Definition at line 162 of file AbstractController.php.

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

◆ 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$requestThe request object
\TYPO3\CMS\Extbase\Mvc\ResponseInterface$responseThe response, modified by this handler
Returns
void
Exceptions

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

Definition at line 232 of file AbstractController.php.

References TYPO3\CMS\Extbase\Mvc\Controller\AbstractController\$controllerContext, TYPO3\CMS\Extbase\Mvc\Controller\AbstractController\$request, TYPO3\CMS\Extbase\Mvc\Controller\AbstractController\$response, TYPO3\CMS\Extbase\Mvc\Controller\AbstractController\canProcessRequest(), and TYPO3\CMS\Extbase\Mvc\Controller\AbstractController\initializeControllerArgumentsBaseValidators().

◆ 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$actionNameName of the action to forward to
string$controllerNameUnqualified object name of the controller to forward to. If not specified, the current controller is used.
string$extensionNameName of the extension containing the controller to forward to. If not specified, the current extension is assumed.
array$argumentsArguments to pass to the target action
integer$pageUidTarget page uid. If NULL, the current page uid is used
integer$delay(optional) The delay in seconds. Default is no delay.
integer$statusCode(optional) The HTTP status code for the redirect. Default is "303 See Other
Returns
void
Exceptions

Definition at line 321 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 OliverHader\IrreTutorial\Controller\ContentController\createAction(), OliverHader\IrreTutorial\Controller\ContentController\deleteAction(), TYPO3\CMS\Reports\Controller\ReportController\detailAction(), TYPO3\CMS\Documentation\Controller\DocumentController\downloadAction(), TYPO3\CMS\Extensionmanager\Controller\UploadExtensionFileController\extractAction(), TYPO3\CMS\Documentation\Controller\DocumentController\fetchAction(), TYPO3\CMS\Workspaces\Controller\ReviewController\indexAction(), TYPO3\CMS\Reports\Controller\ReportController\initializeAction(), TYPO3\CMS\Extensionmanager\Controller\DownloadController\installDistributionAction(), TYPO3\CMS\Extensionmanager\Controller\ConfigurationController\saveAndCloseAction(), TYPO3\CMS\Extensionmanager\Controller\ActionController\toggleExtensionInstallationStateAction(), OliverHader\IrreTutorial\Controller\ContentController\updateAction(), and TYPO3\CMS\Lang\Controller\LanguageController\updateLanguageSelectionAction().

◆ 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$uriA string representation of a URI
integer$delay(optional) The delay in seconds. Default is no delay.
integer$statusCode(optional) The HTTP status code for the redirect. Default is "303 See Other
Exceptions

Definition at line 348 of file AbstractController.php.

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

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

◆ 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
integer$statusCodeThe HTTP status code
string$statusMessageA custom HTTP status message
string$contentBody content which further explains the status
Exceptions

Definition at line 385 of file AbstractController.php.

Member Data Documentation

◆ $arguments

◆ $argumentsMappingResults

TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::$argumentsMappingResults
protected

Definition at line 93 of file AbstractController.php.

◆ $configurationManager

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

◆ $controllerContext

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

◆ $deprecatedPropertyMapper

TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::$deprecatedPropertyMapper
protected

Definition at line 73 of file AbstractController.php.

◆ $extensionName

TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::$extensionName
protected

◆ $flashMessageContainer

TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::$flashMessageContainer
protected

◆ $objectManager

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

◆ $request

◆ $response

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

◆ $settings

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

Definition at line 50 of file AbstractController.php.

◆ $signalSlotDispatcher

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

Definition at line 27 of file AbstractController.php.

◆ $supportedRequestTypes

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

Definition at line 102 of file AbstractController.php.

◆ $uriBuilder

◆ $validatorResolver

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

Definition at line 79 of file AbstractController.php.