TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
AbstractController Class Reference
Inheritance diagram for AbstractController:
ControllerInterface ActionController DummyController BlogController AbstractController AboutController ModulesController AbstractController BackendUserActionController PermissionController HelpController DocumentController AbstractController FileListController AbstractWidgetController AbstractBackendController FormFrontendController AdministrationController SearchController LanguageController RecyclerModuleController ReportController NoteController ViewModuleController AbstractController

Public Member Functions

 injectSignalSlotDispatcher (\TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher)
 
 injectValidatorResolver (\TYPO3\CMS\Extbase\Validation\ValidatorResolver $validatorResolver)
 
 getControllerContext ()
 
 __construct ()
 
 injectConfigurationManager (ConfigurationManagerInterface $configurationManager)
 
 injectObjectManager (\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager)
 
 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)
 

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
 
 $validatorResolver
 
 $arguments
 
 $supportedRequestTypes = [\TYPO3\CMS\Extbase\Mvc\Request::class]
 
 $controllerContext
 
 $configurationManager
 

Detailed Description

An abstract base class for Controllers

Definition at line 27 of file extbase/Classes/Mvc/Controller/AbstractController.php.

Constructor & Destructor Documentation

__construct ( )

Constructs the controller.

Definition at line 131 of file extbase/Classes/Mvc/Controller/AbstractController.php.

Member Function Documentation

addBaseUriIfNecessary (   $uri)
protected

Adds the base uri if not already in place.

Parameters
string$uriThe URI
Returns
string

Definition at line 367 of file extbase/Classes/Mvc/Controller/AbstractController.php.

Referenced by AbstractController\redirectToUri().

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
int$severityOptional severity, must be one of constants
bool$storeInSessionOptional, defines whether the message should be stored in the session (default) or not
Returns
void
Exceptions
InvalidArgumentException if the message body is no string
See also

Definition at line 181 of file extbase/Classes/Mvc/Controller/AbstractController.php.

References GeneralUtility\makeInstance().

Referenced by ListController\addComposerModeNotification(), ActionController\addErrorFlashMessage(), FormManagerController\deleteAction(), PermissionController\editAction(), UploadExtensionFileController\extractAction(), DocumentController\fetchAction(), DownloadController\installDistributionAction(), ActionController\removeExtensionAction(), BackendUserController\terminateBackendUserSessionAction(), ActionController\toggleExtensionInstallationStateAction(), and DownloadController\updateExtensionAction().

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$requestThe current request
Returns
bool TRUE if this request type is supported, otherwise FALSE

Implements ControllerInterface.

Definition at line 204 of file extbase/Classes/Mvc/Controller/AbstractController.php.

Referenced by ActionController\processRequest(), and AbstractController\processRequest().

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$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
StopActionException
See also
redirect()

Definition at line 276 of file extbase/Classes/Mvc/Controller/AbstractController.php.

References AbstractController\$arguments, and AbstractController\$extensionName.

Referenced by BackendUserController\addToCompareListAction(), HelpController\detailAction(), ActionController\forwardToReferringRequest(), QueueController\indexAction(), DownloadController\installDistributionAction(), ActionController\installExtensionWithoutSystemDependencyCheckAction(), DownloadController\installExtensionWithoutSystemDependencyCheckAction(), FormFrontendController\performAction(), AbstractController\process(), QueueController\processAction(), BackendUserController\removeFromCompareListAction(), FileListController\searchAction(), and BackendUserController\terminateBackendUserSessionAction().

getControllerContext ( )
injectConfigurationManager ( ConfigurationManagerInterface  $configurationManager)
Parameters
ConfigurationManagerInterface$configurationManager
Returns
void

Definition at line 151 of file extbase/Classes/Mvc/Controller/AbstractController.php.

References AbstractController\$configurationManager, and ConfigurationManagerInterface\CONFIGURATION_TYPE_SETTINGS.

injectObjectManager ( \TYPO3\CMS\Extbase\Object\ObjectManagerInterface  $objectManager)

Injects the object manager

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

Definition at line 163 of file extbase/Classes/Mvc/Controller/AbstractController.php.

References AbstractController\$objectManager.

injectSignalSlotDispatcher ( \TYPO3\CMS\Extbase\SignalSlot\Dispatcher  $signalSlotDispatcher)
Parameters
\TYPO3\CMS\Extbase\SignalSlot\Dispatcher$signalSlotDispatcher

Definition at line 86 of file extbase/Classes/Mvc/Controller/AbstractController.php.

References AbstractController\$signalSlotDispatcher.

injectValidatorResolver ( \TYPO3\CMS\Extbase\Validation\ValidatorResolver  $validatorResolver)
Parameters
\TYPO3\CMS\Extbase\Validation\ValidatorResolver$validatorResolver

Definition at line 94 of file extbase/Classes/Mvc/Controller/AbstractController.php.

References AbstractController\$validatorResolver.

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
UnsupportedRequestTypeExceptionif the controller doesn't support the current request type

Implements ControllerInterface.

Definition at line 223 of file extbase/Classes/Mvc/Controller/AbstractController.php.

References AbstractController\$request, AbstractController\$response, and AbstractController\canProcessRequest().

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
int$pageUidTarget 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
Returns
void
Exceptions
UnsupportedRequestTypeExceptionIf the request is not a web request
StopActionException
See also
forward()

Definition at line 315 of file extbase/Classes/Mvc/Controller/AbstractController.php.

References AbstractController\$arguments, AbstractController\$extensionName, and AbstractController\redirectToUri().

Referenced by ContentController\createAction(), ContentController\deleteAction(), FormManagerController\deleteAction(), AdministrationController\deleteIndexedItemAction(), ReportController\detailAction(), DocumentController\downloadAction(), UploadExtensionFileController\extractAction(), DocumentController\fetchAction(), SearchController\initialize(), ReportController\initializeAction(), DownloadController\installDistributionAction(), ConfigurationController\saveAndCloseAction(), AdministrationController\saveStopwordsKeywordsAction(), AdministrationController\statisticDetailsAction(), ActionController\toggleExtensionInstallationStateAction(), ContentController\updateAction(), and PermissionController\updateAction().

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
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
UnsupportedRequestTypeExceptionIf the request is not a web request
StopActionException

Definition at line 343 of file extbase/Classes/Mvc/Controller/AbstractController.php.

References AbstractController\addBaseUriIfNecessary().

Referenced by AbstractController\redirect().

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$statusCodeThe HTTP status code
string$statusMessageA custom HTTP status message
string$contentBody content which further explains the status
Exceptions
UnsupportedRequestTypeExceptionIf the request is not a web request
StopActionException

Definition at line 384 of file extbase/Classes/Mvc/Controller/AbstractController.php.

Member Data Documentation

$configurationManager
protected
$controllerContext
protected
$request
protected
$response
protected
$settings
protected
$signalSlotDispatcher
protected
$supportedRequestTypes = [\TYPO3\CMS\Extbase\Mvc\Request::class]
protected
$validatorResolver
protected