Attention
TYPO3 v12 has reached end-of-life as of April 30th 2026 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.
Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v12 here: TYPO3 ELTS.
ModuleProvider
The
Module API allows extension authors to work with the
registered modules.
This API is the central point to retrieve modules, since it automatically performs necessary access checks and prepares specific structures, for example for the use in menus.
ModuleProvider API
- class ModuleProvider
-
- Fully qualified name
-
\TYPO3\
CMS\ Backend\ Module\ Module Provider
This is the central point to retrieve modules from the ModuleRegistry, while performing the necessary access checks, which ModuleRegistry does not deal with.
- isModuleRegistered ( string $identifier)
-
Simple wrapper for the registry, which just checks if a module is registered. Does NOT perform any access checks.
- param $identifier
-
the identifier
- Returns
-
bool
- getModule ( string $identifier, ?\TYPO3\CMS\Core\Authentication\BackendUserAuthentication $user = NULL, bool $respectWorkspaceRestrictions = true)
-
Returns a Module for the given identifier. In case a user is given, also access checks are performed.
- param $identifier
-
the identifier
- param $user
-
the user, default: NULL
- param $respectWorkspaceRestrictions
-
the respectWorkspaceRestrictions, default: true
- Returns
-
?TYPO3CMSBackendModule Module Interface
- getModules ( ?\TYPO3\CMS\Core\Authentication\BackendUserAuthentication $user = NULL, bool $respectWorkspaceRestrictions = true, bool $grouped = true)
-
Returns all modules either grouped by main modules or flat.
In case a user is given, also access checks are performed.
- param $user
-
the user, default: NULL
- param $respectWorkspaceRestrictions
-
the respectWorkspaceRestrictions, default: true
- param $grouped
-
the grouped, default: true
- Returns
-
ModuleInterface []
-
Return the requested (main) module if exist and allowed, prepared for menu generation or similar structured output (nested). Takes TSConfig into account. Does not respect "appearance[renderInModuleMenu]".
- param $identifier
-
the identifier
- param $user
-
the user
- param $respectWorkspaceRestrictions
-
the respectWorkspaceRestrictions, default: true
- Returns
-
?TYPO3CMSBackendModule Menu Module
-
Returns all allowed modules for the current user, prepared for module menu generation or similar structured output (nested).
Takes TSConfig and "appearance[renderInModuleMenu]" into account.
- param $user
-
the user
- param $respectWorkspaceRestrictions
-
the respectWorkspaceRestrictions, default: true
- Returns
-
MenuModule []
- accessGranted ( string $identifier, \TYPO3\CMS\Core\Authentication\BackendUserAuthentication $user, bool $respectWorkspaceRestrictions = true)
-
Check access of a module for a given user
- param $identifier
-
the identifier
- param $user
-
the user
- param $respectWorkspaceRestrictions
-
the respectWorkspaceRestrictions, default: true
- Returns
-
bool