TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Extbase\Mvc\Controller\ActionController Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Mvc\Controller\ActionController:
TYPO3\CMS\Extbase\Mvc\Controller\AbstractController TYPO3\CMS\Extbase\Mvc\Controller\ControllerInterface 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

 canProcessRequest (\TYPO3\CMS\Extbase\Mvc\RequestInterface $request)
 
 processRequest (\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response)
 
- Public Member Functions inherited from TYPO3\CMS\Extbase\Mvc\Controller\AbstractController
 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 ()
 

Static Public Member Functions

static getActionMethodParameters ($objectManager)
 

Protected Member Functions

 initializeActionMethodArguments ()
 
 initializeActionMethodValidators ()
 
 resolveActionMethodName ()
 
 callActionMethod ()
 
 emitBeforeCallActionMethodSignal (array $preparedArguments)
 
 setViewConfiguration (ViewInterface $view)
 
 getViewProperty ($extbaseFrameworkConfiguration, $setting, $deprecatedSetting='')
 
 resolveViewObjectName ()
 
 initializeView (ViewInterface $view)
 
 initializeAction ()
 
 errorAction ()
 
 getErrorFlashMessage ()
 
 checkRequestHash ()
 
 clearCacheOnError ()
 
- Protected Member Functions inherited from TYPO3\CMS\Extbase\Mvc\Controller\AbstractController
 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

 $reflectionService
 
 $cacheService
 
 $view = NULL
 
 $viewObjectNamePattern = 'Tx_@extension_View_@controller_@action@format'
 
 $namespacesViewObjectNamePattern = '@vendor\@extension\View\@controller\@action@format'
 
 $viewFormatToObjectNameMap = array()
 
 $defaultViewObjectName = 'TYPO3\\CMS\\Fluid\\View\\TemplateView'
 
 $actionMethodName = 'indexAction'
 
 $errorMethodName = 'errorAction'
 
 $mvcPropertyMappingConfigurationService
 
- Protected Attributes inherited from TYPO3\CMS\Extbase\Mvc\Controller\AbstractController
 $signalSlotDispatcher
 
 $objectManager
 
 $uriBuilder
 
 $extensionName
 
 $settings
 
 $request
 
 $response
 
 $deprecatedPropertyMapper
 
 $validatorResolver
 
 $arguments
 
 $argumentsMappingResults
 
 $supportedRequestTypes = array('TYPO3\\CMS\\Extbase\\Mvc\\Request')
 
 $controllerContext
 
 $flashMessageContainer
 
 $configurationManager
 

Detailed Description

A multi action controller. This is by far the most common base class for Controllers.

Definition at line 25 of file ActionController.php.

Member Function Documentation

◆ callActionMethod()

TYPO3\CMS\Extbase\Mvc\Controller\ActionController::callActionMethod ( )
protected

Calls the specified action method and passes the arguments.

If the action returns a string, it is appended to the content in the response object. If the action doesn't return anything and a valid view exists, the view is rendered automatically.

Returns
void

Definition at line 277 of file ActionController.php.

References TYPO3\CMS\Extbase\Mvc\Controller\ActionController\emitBeforeCallActionMethodSignal().

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

◆ canProcessRequest()

TYPO3\CMS\Extbase\Mvc\Controller\ActionController::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 117 of file ActionController.php.

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

◆ checkRequestHash()

TYPO3\CMS\Extbase\Mvc\Controller\ActionController::checkRequestHash ( )
protected

Checks the request hash (HMAC), if arguments have been touched by the property mapper.

In case the -Annotation has been set, this suppresses the exception.

Returns
void
Exceptions

Definition at line 615 of file ActionController.php.

References TYPO3\CMS\Extbase\Mvc\Controller\Argument\ORIGIN_NEWLY_CREATED, and TYPO3\CMS\Extbase\Mvc\Controller\Argument\ORIGIN_PERSISTENCE_AND_MODIFIED.

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

◆ clearCacheOnError()

TYPO3\CMS\Extbase\Mvc\Controller\ActionController::clearCacheOnError ( )
protected

Clear cache of current page on error. Needed because we want a re-evaluation of the data. Better would be just do delete the cache for the error action, but that is not possible right now.

Returns
void

Definition at line 648 of file ActionController.php.

References $GLOBALS, and TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface\CONFIGURATION_TYPE_FRAMEWORK.

Referenced by TYPO3\CMS\Extbase\Mvc\Controller\ActionController\errorAction().

◆ emitBeforeCallActionMethodSignal()

TYPO3\CMS\Extbase\Mvc\Controller\ActionController::emitBeforeCallActionMethodSignal ( array  $preparedArguments)
protected

◆ errorAction()

TYPO3\CMS\Extbase\Mvc\Controller\ActionController::errorAction ( )
protected

A special action which is called if the originally intended action could not be called, for example if the arguments were not valid.

The default implementation sets a flash message, request errors and forwards back to the originating action. This is suitable for most actions dealing with form input.

We clear the page cache by default on an error as well, as we need to make sure the data is re-evaluated when the user changes something.

Returns
string

Definition at line 549 of file ActionController.php.

References TYPO3\CMS\Extbase\Mvc\Controller\AbstractController\$request, TYPO3\CMS\Extbase\Mvc\Controller\ActionController\clearCacheOnError(), TYPO3\CMS\Extbase\Mvc\Controller\AbstractController\forward(), and TYPO3\CMS\Extbase\Mvc\Controller\ActionController\getErrorFlashMessage().

◆ getActionMethodParameters()

static TYPO3\CMS\Extbase\Mvc\Controller\ActionController::getActionMethodParameters (   $objectManager)
static

Returns a map of action method names and their parameters.

Parameters
\TYPO3\CMS\Extbase\Object\ObjectManagerInterface$objectManager
Returns
array Array of method parameters by action name

Definition at line 665 of file ActionController.php.

References TYPO3\CMS\Extbase\Mvc\Controller\AbstractController\$objectManager, TYPO3\CMS\Extbase\Mvc\Controller\ActionController\$reflectionService, and $result.

◆ getErrorFlashMessage()

TYPO3\CMS\Extbase\Mvc\Controller\ActionController::getErrorFlashMessage ( )
protected

A template method for displaying custom error flash messages, or to display no flash message at all on errors. Override this to customize the flash message in your action controller.

Returns
string The flash message or FALSE if no flash message should be set

Definition at line 602 of file ActionController.php.

Referenced by TYPO3\CMS\Extbase\Mvc\Controller\ActionController\errorAction().

◆ getViewProperty()

TYPO3\CMS\Extbase\Mvc\Controller\ActionController::getViewProperty (   $extbaseFrameworkConfiguration,
  $setting,
  $deprecatedSetting = '' 
)
protected

Handles the path resolving for *rootPath(s) singular one is deprecated and will be removed two versions after 6.2 if deprecated setting is found, use it as the very last fallback target

numerical arrays get ordered by key ascending

Parameters
array$extbaseFrameworkConfiguration
string$settingparameter name from TypoScript
string$deprecatedSettingparameter name from TypoScript
Returns
array

Definition at line 448 of file ActionController.php.

References TYPO3\CMS\Extbase\Utility\ArrayUtility\sortArrayWithIntegerKeys().

Referenced by TYPO3\CMS\Extbase\Mvc\Controller\ActionController\setViewConfiguration().

◆ initializeAction()

TYPO3\CMS\Extbase\Mvc\Controller\ActionController::initializeAction ( )
protected

Initializes the controller before invoking an action method.

Override this method to solve tasks which all actions have in common.

Returns
void

Definition at line 533 of file ActionController.php.

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

◆ initializeActionMethodArguments()

TYPO3\CMS\Extbase\Mvc\Controller\ActionController::initializeActionMethodArguments ( )
protected

Implementation of the arguments initilization in the action controller: Automatically registers arguments of the current action

Don't override this method - use initializeAction() instead.

Exceptions

Definition at line 171 of file ActionController.php.

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

◆ initializeActionMethodValidators()

TYPO3\CMS\Extbase\Mvc\Controller\ActionController::initializeActionMethodValidators ( )
protected

Adds the needed validators to the Arguments:

  • Validators checking the data type from the
    Parameters
    annotation
  • Custom validators specified with validate annotations.
  • Model-based validators (validate annotations in the model)
  • Custom model validator classes
Returns
void
Todo:
: add validation group support (https://review.typo3.org/#/c/13556/4)
Todo:
: add resolving of $actionValidateAnnotations and pass them to buildMethodArgumentsValidatorConjunctions as in TYPO3.Flow

Definition at line 198 of file ActionController.php.

References TYPO3\CMS\Extbase\Mvc\Controller\ActionController\$actionMethodName.

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

◆ initializeView()

TYPO3\CMS\Extbase\Mvc\Controller\ActionController::initializeView ( ViewInterface  $view)
protected

Initializes the view before invoking an action method.

Override this method to solve assign variables common for all actions or prepare the view in another way before the action is called.

Parameters
ViewInterface$viewThe view to be initialized
Returns
void

Definition at line 521 of file ActionController.php.

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

◆ processRequest()

◆ resolveActionMethodName()

TYPO3\CMS\Extbase\Mvc\Controller\ActionController::resolveActionMethodName ( )
protected

Resolves and checks the current action method name

Returns
string Method name of the current action
Exceptions

Definition at line 259 of file ActionController.php.

References TYPO3\CMS\Extbase\Mvc\Controller\ActionController\$actionMethodName.

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

◆ resolveViewObjectName()

TYPO3\CMS\Extbase\Mvc\Controller\ActionController::resolveViewObjectName ( )
protected

Determines the fully qualified view object name.

Returns
mixed The fully qualified view object name or FALSE if no matching view could be found.

Definition at line 477 of file ActionController.php.

References TYPO3\CMS\Extbase\Mvc\Controller\ActionController\$viewObjectNamePattern.

Referenced by TYPO3\CMS\Extbase\Mvc\Controller\ActionController\emitBeforeCallActionMethodSignal().

◆ setViewConfiguration()

TYPO3\CMS\Extbase\Mvc\Controller\ActionController::setViewConfiguration ( ViewInterface  $view)
protected

Member Data Documentation

◆ $actionMethodName

TYPO3\CMS\Extbase\Mvc\Controller\ActionController::$actionMethodName = 'indexAction'
protected

◆ $cacheService

TYPO3\CMS\Extbase\Mvc\Controller\ActionController::$cacheService
protected

Definition at line 37 of file ActionController.php.

◆ $defaultViewObjectName

TYPO3\CMS\Extbase\Mvc\Controller\ActionController::$defaultViewObjectName = 'TYPO3\\CMS\\Fluid\\View\\TemplateView'
protected

Definition at line 81 of file ActionController.php.

◆ $errorMethodName

TYPO3\CMS\Extbase\Mvc\Controller\ActionController::$errorMethodName = 'errorAction'
protected

Definition at line 97 of file ActionController.php.

◆ $mvcPropertyMappingConfigurationService

TYPO3\CMS\Extbase\Mvc\Controller\ActionController::$mvcPropertyMappingConfigurationService
protected

Definition at line 104 of file ActionController.php.

◆ $namespacesViewObjectNamePattern

TYPO3\CMS\Extbase\Mvc\Controller\ActionController::$namespacesViewObjectNamePattern = '@vendor\@extension\View\@controller\@action@format'
protected

Definition at line 61 of file ActionController.php.

◆ $reflectionService

TYPO3\CMS\Extbase\Mvc\Controller\ActionController::$reflectionService
protected

◆ $view

TYPO3\CMS\Extbase\Mvc\Controller\ActionController::$view = NULL
protected

◆ $viewFormatToObjectNameMap

TYPO3\CMS\Extbase\Mvc\Controller\ActionController::$viewFormatToObjectNameMap = array()
protected

Definition at line 72 of file ActionController.php.

◆ $viewObjectNamePattern

TYPO3\CMS\Extbase\Mvc\Controller\ActionController::$viewObjectNamePattern = 'Tx_@extension_View_@controller_@action@format'
protected