AdministrationController extends ActionController
Administration controller
This class is a specific controller implementation and is not considered part of the Public TYPO3 API.
Table of Contents
Properties
- $actionMethodName : string
- Name of the action method
- $administrationRepository : AdministrationRepository
- $arguments : Arguments
- $configurationManager : ConfigurationManagerInterface
- $controllerContext : ControllerContext
- $defaultViewObjectName : string
- The default view object to use if none of the resolved views can render a response for the current request.
- $enableMetaphoneSearch : bool
- $errorMethodName : string
- Name of the special error action method which is called in case of errors
- $eventDispatcher : EventDispatcherInterface
- $external_parsers : array<string|int, mixed>
- $hashService : HashService
- $iconFactory : IconFactory
- $indexer : Indexer
- $indexerConfig : array<string|int, mixed>
- $moduleTemplateFactory : ModuleTemplateFactory
- $mvcPropertyMappingConfigurationService : MvcPropertyMappingConfigurationService
- $objectManager : ObjectManagerInterface
- $pageUid : int
- $reflectionService : ReflectionService
- $request : Request
- The current request.
- $responseFactory : ResponseFactoryInterface
- $settings : array<string|int, mixed>
- Contains the settings of the current extension
- $signalSlotDispatcher : Dispatcher
- $streamFactory : StreamFactoryInterface
- $uriBuilder : UriBuilder
- $validatorResolver : ValidatorResolver
- $view : ViewInterface
- The current view, as resolved by resolveView()
Methods
- __construct() : mixed
- addFlashMessage() : mixed
- Creates a Message object and adds it to the FlashMessageQueue.
- deleteIndexedItemAction() : mixed
- Remove item from index
- externalDocumentsAction() : ResponseInterface
- Statistics for external documents
- forward() : never
- Forwards the request to another action and / or controller.
- getControllerContext() : ControllerContext
- indexAction() : ResponseInterface
- Index action contains the most important statistics
- initializeAction() : mixed
- Function will be called before every other action
- initializeControllerArgumentsBaseValidators() : mixed
- Collects the base validators which were defined for the data type of each controller argument and adds them to the argument's validator chain.
- injectConfigurationManager() : mixed
- injectEventDispatcher() : void
- injectHashService() : mixed
- injectInternalExtensionService() : void
- injectInternalFlashMessageService() : void
- injectMvcPropertyMappingConfigurationService() : mixed
- injectObjectManager() : mixed
- Injects the object manager
- injectPropertyMapper() : void
- injectReflectionService() : mixed
- injectResponseFactory() : mixed
- injectSignalSlotDispatcher() : mixed
- injectStreamFactory() : mixed
- injectValidatorResolver() : mixed
- injectViewResolver() : mixed
- pagesAction() : ResponseInterface
- Statistics for pages
- processRequest() : ResponseInterface
- Override the action name if found in the uc of the user
- saveStopwordsKeywordsAction() : mixed
- Save stop words and keywords
- statisticAction() : ResponseInterface
- General statistics
- statisticDetailsAction() : ResponseInterface
- Statistics for a given page hash
- throwStatus() : never
- Sends the specified HTTP status immediately and only stops to run back through the middleware stack.
- wordDetailAction() : ResponseInterface
- Statistics for a given word id
- addBaseUriIfNecessary() : string
- Adds the base uri if not already in place.
- addErrorFlashMessage() : mixed
- If an error occurred during this request, this adds a flash message describing the error to the flash message container.
- buildControllerContext() : ControllerContext
- Initialize the controller context
- callActionMethod() : ResponseInterface
- Calls the specified action method and passes the arguments.
- errorAction() : ResponseInterface
- A special action which is called if the originally intended action could not be called, for example if the arguments were not valid.
- forwardToReferringRequest() : ResponseInterface|null
- 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!
- getBackendUserAuthentication() : BackendUserAuthentication
- getErrorFlashMessage() : string|bool
- 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.
- getFlashMessageQueue() : FlashMessageQueue
- todo: As soon as the incoming request contains the compiled plugin namespace, extbase will offer a trait to create a flash message identifier from the current request. Users then should inject the flash message service themselves if needed.
- getFlattenedValidationErrorMessage() : string
- Returns a string with a basic error message about validation failure.
- getLanguageService() : LanguageService
- getViewProperty() : array<string|int, mixed>
- Handles the path resolving for *rootPath(s)
- htmlResponse() : ResponseInterface
- Returns a response object with either the given html string or the current rendered view as content.
- initializeActionMethodArguments() : mixed
- Implementation of the arguments initialization in the action controller: Automatically registers arguments of the current action
- initializeActionMethodValidators() : mixed
- Adds the needed validators to the Arguments:
- initializeModuleTemplate() : ModuleTemplate
- Generates the action menu
- initializeView() : mixed
- Initializes the view before invoking an action method.
- jsonResponse() : ResponseInterface
- Returns a response object with either the given json string or the current rendered view as content. Mainly to be used for actions / controllers using the JsonView.
- mapRequestArgumentsToControllerArguments() : mixed
- Maps arguments delivered by the request object to the local controller arguments.
- redirect() : never
- Redirects the request to another action and / or controller.
- redirectToUri() : never
- Redirects the web request to another uri.
- renderAssetsForRequest() : mixed
- Method which initializes assets that should be attached to the response for the given $request, which contains parameters that an override can use to determine which assets to add via PageRenderer.
- resolveActionMethodName() : string
- Resolves and checks the current action method name
- resolveView() : ViewInterface
- Prepares a view for the current action.
- setViewConfiguration() : mixed
Properties
$actionMethodName
Name of the action method
protected
string
$actionMethodName
= 'indexAction'
only to be used within Extbase, not part of TYPO3 Core API.
$administrationRepository
protected
AdministrationRepository
$administrationRepository
$arguments
protected
Arguments
$arguments
Arguments passed to the controller
$configurationManager
protected
ConfigurationManagerInterface
$configurationManager
only to be used within Extbase, not part of TYPO3 Core API.
$controllerContext
since v11, will be removed with v12.
protected
ControllerContext
$controllerContext
only to be used within Extbase, not part of TYPO3 Core API.
$defaultViewObjectName
The default view object to use if none of the resolved views can render a response for the current request.
protected
string
$defaultViewObjectName
= \TYPO3\CMS\Fluid\View\TemplateView::class
$enableMetaphoneSearch
protected
bool
$enableMetaphoneSearch
= false
is metaphone enabled
$errorMethodName
Name of the special error action method which is called in case of errors
protected
string
$errorMethodName
= 'errorAction'
$eventDispatcher
protected
EventDispatcherInterface
$eventDispatcher
$external_parsers
protected
array<string|int, mixed>
$external_parsers
= []
External parsers
$hashService
protected
HashService
$hashService
only to be used within Extbase, not part of TYPO3 Core API.
$iconFactory
protected
IconFactory
$iconFactory
$indexer
protected
Indexer
$indexer
$indexerConfig
protected
array<string|int, mixed>
$indexerConfig
= []
Configuration defined in the Extension Manager
$moduleTemplateFactory
protected
ModuleTemplateFactory
$moduleTemplateFactory
$mvcPropertyMappingConfigurationService
protected
MvcPropertyMappingConfigurationService
$mvcPropertyMappingConfigurationService
$objectManager
since v11, will be removed in v12
protected
ObjectManagerInterface
$objectManager
only to be used within Extbase, not part of TYPO3 Core API.
$pageUid
protected
int
$pageUid
= 0
Current page id
$reflectionService
protected
ReflectionService
$reflectionService
only to be used within Extbase, not part of TYPO3 Core API.
$request
The current request.
protected
Request
$request
Tags
$responseFactory
protected
ResponseFactoryInterface
$responseFactory
$settings
Contains the settings of the current extension
protected
array<string|int, mixed>
$settings
$signalSlotDispatcher
protected
Dispatcher
$signalSlotDispatcher
only to be used within Extbase, not part of TYPO3 Core API.
$streamFactory
protected
StreamFactoryInterface
$streamFactory
$uriBuilder
protected
UriBuilder
$uriBuilder
$validatorResolver
protected
ValidatorResolver
$validatorResolver
only to be used within Extbase, not part of TYPO3 Core API.
$view
The current view, as resolved by resolveView()
protected
ViewInterface
$view
Tags
Methods
__construct()
public
__construct(ModuleTemplateFactory $moduleTemplateFactory, AdministrationRepository $administrationRepository, Indexer $indexer, IconFactory $iconFactory) : mixed
Parameters
- $moduleTemplateFactory : ModuleTemplateFactory
- $administrationRepository : AdministrationRepository
- $indexer : Indexer
- $iconFactory : IconFactory
addFlashMessage()
Creates a Message object and adds it to the FlashMessageQueue.
public
addFlashMessage(string $messageBody[, string $messageTitle = '' ][, int $severity = AbstractMessage::OK ][, bool $storeInSession = true ]) : mixed
Parameters
- $messageBody : string
-
The message
- $messageTitle : string = ''
-
Optional message title
- $severity : int = AbstractMessage::OK
-
Optional severity, must be one of \TYPO3\CMS\Core\Messaging\FlashMessage constants
- $storeInSession : bool = true
-
Optional, defines whether the message should be stored in the session (default) or not
Tags
deleteIndexedItemAction()
Remove item from index
public
deleteIndexedItemAction(string $id[, int $depth = 1 ][, string $mode = 'overview' ]) : mixed
Parameters
- $id : string
- $depth : int = 1
- $mode : string = 'overview'
externalDocumentsAction()
Statistics for external documents
public
externalDocumentsAction() : ResponseInterface
Return values
ResponseInterfaceforward()
Forwards the request to another action and / or controller.
public
forward(string|null $actionName[, string|null $controllerName = null ][, string|null $extensionName = null ][, array<string|int, mixed>|null $arguments = null ]) : never
since TYPO3 11.0, will be removed in 12.0
Request is directly transferred to the other action / controller without the need for a new request.
Parameters
- $actionName : string|null
-
Name of the action to forward to
- $controllerName : string|null = null
-
Unqualified object name of the controller to forward to. If not specified, the current controller is used.
- $extensionName : string|null = null
-
Name of the extension containing the controller to forward to. If not specified, the current extension is assumed.
- $arguments : array<string|int, mixed>|null = null
-
Arguments to pass to the target action
Tags
Return values
nevergetControllerContext()
public
getControllerContext() : ControllerContext
since v11, will be removed with v12.
Return values
ControllerContextindexAction()
Index action contains the most important statistics
public
indexAction() : ResponseInterface
Return values
ResponseInterfaceinitializeAction()
Function will be called before every other action
public
initializeAction() : mixed
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.
public
initializeControllerArgumentsBaseValidators() : mixed
only to be used within Extbase, not part of TYPO3 Core API.
injectConfigurationManager()
public
injectConfigurationManager(ConfigurationManagerInterface $configurationManager) : mixed
Parameters
- $configurationManager : ConfigurationManagerInterface
only to be used within Extbase, not part of TYPO3 Core API.
injectEventDispatcher()
public
injectEventDispatcher(EventDispatcherInterface $eventDispatcher) : void
Parameters
- $eventDispatcher : EventDispatcherInterface
injectHashService()
public
injectHashService(HashService $hashService) : mixed
Parameters
- $hashService : HashService
only to be used within Extbase, not part of TYPO3 Core API.
injectInternalExtensionService()
public
final injectInternalExtensionService(ExtensionService $extensionService) : void
Parameters
- $extensionService : ExtensionService
only to be used within Extbase, not part of TYPO3 Core API.
injectInternalFlashMessageService()
public
final injectInternalFlashMessageService(FlashMessageService $flashMessageService) : void
Parameters
- $flashMessageService : FlashMessageService
only to be used within Extbase, not part of TYPO3 Core API.
injectMvcPropertyMappingConfigurationService()
public
injectMvcPropertyMappingConfigurationService(MvcPropertyMappingConfigurationService $mvcPropertyMappingConfigurationService) : mixed
Parameters
- $mvcPropertyMappingConfigurationService : MvcPropertyMappingConfigurationService
injectObjectManager()
Injects the object manager
public
injectObjectManager(ObjectManagerInterface $objectManager) : mixed
since v11, will be removed in v12
Parameters
- $objectManager : ObjectManagerInterface
only to be used within Extbase, not part of TYPO3 Core API.
injectPropertyMapper()
public
injectPropertyMapper(PropertyMapper $propertyMapper) : void
Parameters
- $propertyMapper : PropertyMapper
only to be used within Extbase, not part of TYPO3 Core API.
injectReflectionService()
public
injectReflectionService(ReflectionService $reflectionService) : mixed
Parameters
- $reflectionService : ReflectionService
only to be used within Extbase, not part of TYPO3 Core API.
injectResponseFactory()
public
final injectResponseFactory(ResponseFactoryInterface $responseFactory) : mixed
Parameters
- $responseFactory : ResponseFactoryInterface
injectSignalSlotDispatcher()
public
injectSignalSlotDispatcher(Dispatcher $signalSlotDispatcher) : mixed
since v11, will be removed in v12
Parameters
- $signalSlotDispatcher : Dispatcher
only to be used within Extbase, not part of TYPO3 Core API.
injectStreamFactory()
public
final injectStreamFactory(StreamFactoryInterface $streamFactory) : mixed
Parameters
- $streamFactory : StreamFactoryInterface
injectValidatorResolver()
public
injectValidatorResolver(ValidatorResolver $validatorResolver) : mixed
Parameters
- $validatorResolver : ValidatorResolver
only to be used within Extbase, not part of TYPO3 Core API.
injectViewResolver()
public
injectViewResolver(ViewResolverInterface $viewResolver) : mixed
Parameters
- $viewResolver : ViewResolverInterface
only to be used within Extbase, not part of TYPO3 Core API.
pagesAction()
Statistics for pages
public
pagesAction() : ResponseInterface
Return values
ResponseInterfaceprocessRequest()
Override the action name if found in the uc of the user
public
processRequest(RequestInterface $request) : ResponseInterface
Parameters
- $request : RequestInterface
Return values
ResponseInterfacesaveStopwordsKeywordsAction()
Save stop words and keywords
public
saveStopwordsKeywordsAction(string $pageHash, int $pageId[, array<string|int, mixed> $stopwords = [] ][, array<string|int, mixed> $keywords = [] ]) : mixed
Parameters
- $pageHash : string
- $pageId : int
- $stopwords : array<string|int, mixed> = []
- $keywords : array<string|int, mixed> = []
statisticAction()
General statistics
public
statisticAction([int $depth = 1 ][, string $mode = 'overview' ]) : ResponseInterface
Parameters
- $depth : int = 1
- $mode : string = 'overview'
Return values
ResponseInterfacestatisticDetailsAction()
Statistics for a given page hash
public
statisticDetailsAction([int $pageHash = 0 ]) : ResponseInterface
Parameters
- $pageHash : int = 0
Return values
ResponseInterfacethrowStatus()
Sends the specified HTTP status immediately and only stops to run back through the middleware stack.
public
throwStatus(int $statusCode[, string $statusMessage = null ][, string $content = null ]) : never
Note: If any other plugin or content or hook is used within a frontend request, this is skipped by design.
Parameters
- $statusCode : int
-
The HTTP status code
- $statusMessage : string = null
-
A custom HTTP status message
- $content : string = null
-
Body content which further explains the status
Tags
Return values
neverwordDetailAction()
Statistics for a given word id
public
wordDetailAction([int $id = 0 ][, int $pageHash = 0 ]) : ResponseInterface
Parameters
- $id : int = 0
- $pageHash : int = 0
Return values
ResponseInterfaceaddBaseUriIfNecessary()
Adds the base uri if not already in place.
protected
addBaseUriIfNecessary(string $uri) : string
Parameters
- $uri : string
-
The URI
only to be used within Extbase, not part of TYPO3 Core API.
Return values
stringaddErrorFlashMessage()
If an error occurred during this request, this adds a flash message describing the error to the flash message container.
protected
addErrorFlashMessage() : mixed
only to be used within Extbase, not part of TYPO3 Core API.
buildControllerContext()
Initialize the controller context
protected
buildControllerContext() : ControllerContext
since v11, will be removed with v12.
only to be used within Extbase, not part of TYPO3 Core API.
Return values
ControllerContext —ControllerContext to be passed to the view
callActionMethod()
Calls the specified action method and passes the arguments.
protected
callActionMethod(RequestInterface $request) : ResponseInterface
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.
Parameters
- $request : RequestInterface
only to be used within Extbase, not part of TYPO3 Core API.
Return values
ResponseInterfaceerrorAction()
A special action which is called if the originally intended action could not be called, for example if the arguments were not valid.
protected
errorAction() : ResponseInterface
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.
Return values
ResponseInterfaceforwardToReferringRequest()
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!
protected
forwardToReferringRequest() : ResponseInterface|null
only to be used within Extbase, not part of TYPO3 Core API.
Return values
ResponseInterface|nullgetBackendUserAuthentication()
protected
getBackendUserAuthentication() : BackendUserAuthentication
Return values
BackendUserAuthenticationgetErrorFlashMessage()
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.
protected
getErrorFlashMessage() : string|bool
only to be used within Extbase, not part of TYPO3 Core API.
Return values
string|bool —The flash message or FALSE if no flash message should be set
getFlashMessageQueue()
todo: As soon as the incoming request contains the compiled plugin namespace, extbase will offer a trait to create a flash message identifier from the current request. Users then should inject the flash message service themselves if needed.
protected
getFlashMessageQueue([string|null $identifier = null ]) : FlashMessageQueue
Parameters
- $identifier : string|null = null
only to be used within Extbase, not part of TYPO3 Core API.
Return values
FlashMessageQueuegetFlattenedValidationErrorMessage()
Returns a string with a basic error message about validation failure.
protected
getFlattenedValidationErrorMessage() : string
We may add all validation error messages to a log file in the future, but for security reasons (@see #54074) we do not return these here.
only to be used within Extbase, not part of TYPO3 Core API.
Return values
stringgetLanguageService()
protected
getLanguageService() : LanguageService
Return values
LanguageServicegetViewProperty()
Handles the path resolving for *rootPath(s)
protected
getViewProperty(array<string|int, mixed> $extbaseFrameworkConfiguration, string $setting) : array<string|int, mixed>
numerical arrays get ordered by key ascending
Parameters
- $extbaseFrameworkConfiguration : array<string|int, mixed>
- $setting : string
-
parameter name from TypoScript
only to be used within Extbase, not part of TYPO3 Core API.
Return values
array<string|int, mixed>htmlResponse()
Returns a response object with either the given html string or the current rendered view as content.
protected
htmlResponse([string|null $html = null ]) : ResponseInterface
Parameters
- $html : string|null = null
Return values
ResponseInterfaceinitializeActionMethodArguments()
Implementation of the arguments initialization in the action controller: Automatically registers arguments of the current action
protected
initializeActionMethodArguments() : mixed
Don't override this method - use initializeAction() instead.
only to be used within Extbase, not part of TYPO3 Core API.
Tags
initializeActionMethodValidators()
Adds the needed validators to the Arguments:
protected
initializeActionMethodValidators() : mixed
- Validators checking the data type from the @param annotation
- Custom validators specified with validate annotations.
- Model-based validators (validate annotations in the model)
- Custom model validator classes
only to be used within Extbase, not part of TYPO3 Core API.
initializeModuleTemplate()
Generates the action menu
protected
initializeModuleTemplate(ServerRequestInterface $request) : ModuleTemplate
Parameters
- $request : ServerRequestInterface
Return values
ModuleTemplateinitializeView()
Initializes the view before invoking an action method.
protected
initializeView(ViewInterface $view) : mixed
since v11, will be removed in v12: Drop method along with extbase ViewInterface.
Override this method to solve assign variables common for all actions or prepare the view in another way before the action is called.
Parameters
- $view : ViewInterface
-
The view to be initialized
jsonResponse()
Returns a response object with either the given json string or the current rendered view as content. Mainly to be used for actions / controllers using the JsonView.
protected
jsonResponse([string|null $json = null ]) : ResponseInterface
Parameters
- $json : string|null = null
Return values
ResponseInterfacemapRequestArgumentsToControllerArguments()
Maps arguments delivered by the request object to the local controller arguments.
protected
mapRequestArgumentsToControllerArguments() : mixed
only to be used within Extbase, not part of TYPO3 Core API.
Tags
redirect()
Redirects the request to another action and / or controller.
protected
redirect(string|null $actionName[, string|null $controllerName = null ][, string|null $extensionName = null ][, array<string|int, mixed>|null $arguments = null ][, int|null $pageUid = null ][, null $_ = null ][, int $statusCode = 303 ]) : never
Redirect will be sent to the client which then performs another request to the new URI.
Parameters
- $actionName : string|null
-
Name of the action to forward to
- $controllerName : string|null = null
-
Unqualified object name of the controller to forward to. If not specified, the current controller is used.
- $extensionName : string|null = null
-
Name of the extension containing the controller to forward to. If not specified, the current extension is assumed.
- $arguments : array<string|int, mixed>|null = null
-
Arguments to pass to the target action
- $pageUid : int|null = null
-
Target page uid. If NULL, the current page uid is used
- $_ : null = null
-
(optional) Unused
- $statusCode : int = 303
-
(optional) The HTTP status code for the redirect. Default is "303 See Other
Tags
Return values
neverredirectToUri()
Redirects the web request to another uri.
protected
redirectToUri(mixed $uri[, null $_ = null ][, int $statusCode = 303 ]) : never
Parameters
- $uri : mixed
-
A string representation of a URI
- $_ : null = null
-
(optional) Unused
- $statusCode : int = 303
-
(optional) The HTTP status code for the redirect. Default is "303 See Other"
Tags
Return values
neverrenderAssetsForRequest()
Method which initializes assets that should be attached to the response for the given $request, which contains parameters that an override can use to determine which assets to add via PageRenderer.
protected
renderAssetsForRequest(RequestInterface $request) : mixed
This default implementation will attempt to render the sections "HeaderAssets" and "FooterAssets" from the template that is being rendered, inserting the rendered content into either page header or footer, as appropriate. Both sections are optional and can be used one or both in combination.
You can add assets with this method without worrying about duplicates, if for example you do this in a plugin that gets used multiple time on a page.
Parameters
- $request : RequestInterface
only to be used within Extbase, not part of TYPO3 Core API.
resolveActionMethodName()
Resolves and checks the current action method name
protected
resolveActionMethodName() : string
only to be used within Extbase, not part of TYPO3 Core API.
Tags
Return values
string —Method name of the current action
resolveView()
Prepares a view for the current action.
protected
resolveView() : ViewInterface
By default, this method tries to locate a view with a name matching the current action.
only to be used within Extbase, not part of TYPO3 Core API.
Tags
Return values
ViewInterfacesetViewConfiguration()
protected
setViewConfiguration(ViewInterface $view) : mixed
Parameters
- $view : ViewInterface
only to be used within Extbase, not part of TYPO3 Core API.