TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
ActionController Class Reference
Inheritance diagram for ActionController:
AbstractController ControllerInterface 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

 injectReflectionService (\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService)
 
 injectCacheService (\TYPO3\CMS\Extbase\Service\CacheService $cacheService)
 
 injectMvcPropertyMappingConfigurationService (\TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService $mvcPropertyMappingConfigurationService)
 
 processRequest (\TYPO3\CMS\Extbase\Mvc\RequestInterface $request,\TYPO3\CMS\Extbase\Mvc\ResponseInterface $response)
 
- Public Member Functions inherited from AbstractController
 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)
 

Static Public Member Functions

static getActionMethodParameters ($objectManager)
 

Protected Member Functions

 initializeActionMethodArguments ()
 
 resolveActionMethodName ()
 
 emitBeforeCallActionMethodSignal (array $preparedArguments)
 
 setViewConfiguration (ViewInterface $view)
 
 getViewProperty ($extbaseFrameworkConfiguration, $setting)
 
 resolveViewObjectName ()
 
 initializeView (ViewInterface $view)
 
 initializeAction ()
 
 errorAction ()
 
 clearCacheOnError ()
 
 addErrorFlashMessage ()
 
 getErrorFlashMessage ()
 
 forwardToReferringRequest ()
 
 getFlattenedValidationErrorMessage ()
 
- Protected Member Functions inherited from 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
 
 $namespacesViewObjectNamePattern = '@vendor\@extension\View\@controller\@action@format'
 
 $viewFormatToObjectNameMap = []
 
 $defaultViewObjectName = \TYPO3\CMS\Fluid\View\TemplateView::class
 
 $actionMethodName = 'indexAction'
 
 $errorMethodName = 'errorAction'
 
 $mvcPropertyMappingConfigurationService
 
 $request
 
 $response
 
- Protected Attributes inherited from AbstractController
 $signalSlotDispatcher
 
 $objectManager
 
 $uriBuilder
 
 $extensionName
 
 $settings
 
 $request
 
 $response
 
 $validatorResolver
 
 $arguments
 
 $supportedRequestTypes = [\TYPO3\CMS\Extbase\Mvc\Request::class]
 
 $controllerContext
 
 $configurationManager
 

Detailed Description

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

Definition at line 29 of file extbase/Classes/Mvc/Controller/ActionController.php.

Member Function Documentation

addErrorFlashMessage ( )
protected

If an error occurred during this request, this adds a flash message describing the error to the flash message container.

Returns
void

Definition at line 552 of file extbase/Classes/Mvc/Controller/ActionController.php.

References AbstractController\addFlashMessage(), AbstractMessage\ERROR, and ActionController\getErrorFlashMessage().

Referenced by ActionController\errorAction().

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 535 of file extbase/Classes/Mvc/Controller/ActionController.php.

References $GLOBALS, and ConfigurationManagerInterface\CONFIGURATION_TYPE_FRAMEWORK.

Referenced by ActionController\errorAction().

emitBeforeCallActionMethodSignal ( array  $preparedArguments)
protected

Emits a signal before the current action is called

Parameters
array$preparedArguments

Definition at line 324 of file extbase/Classes/Mvc/Controller/ActionController.php.

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 520 of file extbase/Classes/Mvc/Controller/ActionController.php.

References ActionController\addErrorFlashMessage(), ActionController\clearCacheOnError(), ActionController\forwardToReferringRequest(), and ActionController\getFlattenedValidationErrorMessage().

forwardToReferringRequest ( )
protected

If information on the request before the current request was sent, this method forwards back to the originating request. This effectively ends processing of the current request, so do not call this method before you have finished the necessary business logic!

Returns
void
Exceptions
StopActionException

Definition at line 581 of file extbase/Classes/Mvc/Controller/ActionController.php.

References ActionController\$request, and AbstractController\forward().

Referenced by ActionController\errorAction().

static 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 617 of file extbase/Classes/Mvc/Controller/ActionController.php.

References AbstractController\$objectManager, and ActionController\$reflectionService.

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 568 of file extbase/Classes/Mvc/Controller/ActionController.php.

Referenced by ActionController\addErrorFlashMessage().

getFlattenedValidationErrorMessage ( )
protected

Returns a string with a basic error message about validation failure. We may add all validation error messages to a log file in the future, but for security reasons (

See also
#54074) we do not return these here.
Returns
string

Definition at line 604 of file extbase/Classes/Mvc/Controller/ActionController.php.

Referenced by ActionController\errorAction().

getViewProperty (   $extbaseFrameworkConfiguration,
  $setting 
)
protected

Handles the path resolving for *rootPath(s)

numerical arrays get ordered by key ascending

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

Definition at line 427 of file extbase/Classes/Mvc/Controller/ActionController.php.

Referenced by ActionController\setViewConfiguration().

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 503 of file extbase/Classes/Mvc/Controller/ActionController.php.

Referenced by ActionController\processRequest().

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
TYPO3
Returns
void
See also
initializeArguments()

Definition at line 188 of file extbase/Classes/Mvc/Controller/ActionController.php.

Referenced by ActionController\processRequest().

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 490 of file extbase/Classes/Mvc/Controller/ActionController.php.

Referenced by ActionController\processRequest().

injectCacheService ( \TYPO3\CMS\Extbase\Service\CacheService  $cacheService)
Parameters
\TYPO3\CMS\Extbase\Service\CacheService$cacheService

Definition at line 124 of file extbase/Classes/Mvc/Controller/ActionController.php.

References ActionController\$cacheService.

injectMvcPropertyMappingConfigurationService ( \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService  $mvcPropertyMappingConfigurationService)
Parameters
\TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService$mvcPropertyMappingConfigurationService

Definition at line 132 of file extbase/Classes/Mvc/Controller/ActionController.php.

References ActionController\$mvcPropertyMappingConfigurationService.

injectReflectionService ( \TYPO3\CMS\Extbase\Reflection\ReflectionService  $reflectionService)
Parameters
\TYPO3\CMS\Extbase\Reflection\ReflectionService$reflectionService

Definition at line 116 of file extbase/Classes/Mvc/Controller/ActionController.php.

References ActionController\$reflectionService.

Handles a request. The result output is 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
Exceptions
TYPO3
Returns
void

Implements ControllerInterface.

Definition at line 146 of file extbase/Classes/Mvc/Controller/ActionController.php.

References ActionController\$request, ActionController\$response, AbstractController\canProcessRequest(), ActionController\initializeAction(), ActionController\initializeActionMethodArguments(), ActionController\initializeView(), and ActionController\resolveActionMethodName().

resolveActionMethodName ( )
protected

Resolves and checks the current action method name

Returns
string Method name of the current action
Exceptions
TYPO3 if the action specified in the request object does not exist (and if there's no default action either).

Definition at line 253 of file extbase/Classes/Mvc/Controller/ActionController.php.

References ActionController\$actionMethodName.

Referenced by ActionController\processRequest().

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 446 of file extbase/Classes/Mvc/Controller/ActionController.php.

setViewConfiguration ( ViewInterface  $view)
protected

Member Data Documentation

$actionMethodName = 'indexAction'
protected
$cacheService
protected
$defaultViewObjectName = \TYPO3\CMS\Fluid\View\TemplateView::class
protected
$errorMethodName = 'errorAction'
protected
$mvcPropertyMappingConfigurationService
protected
$namespacesViewObjectNamePattern = '@vendor\@extension\View\@controller\@action@format'
protected
$view = null
protected
$viewFormatToObjectNameMap = []
protected