ExtensionUtility
Utilities to manage plugins and modules of an extension. Also useful to auto-generate the autoloader registry file ext_autoload.php.
Table of Contents
Constants
- PLUGIN_TYPE_CONTENT_ELEMENT = 'CType'
- PLUGIN_TYPE_PLUGIN = 'list_type'
Methods
- configurePlugin() : mixed
- Add auto-generated TypoScript to configure the Extbase Dispatcher.
- registerControllerActions() : void
- registerModule() : mixed
- To allow extension authors to support multiple versions, this method is kept until TYPO3 v13, but is no longer used nor evaluated from TYPO3 v12.0. To register modules, place the configuration in your extensions' Configuration/Backend/Modules.php file.
- registerPlugin() : string
- Register an Extbase PlugIn into backend's list of plugins FOR USE IN Configuration/TCA/Overrides/tt_content.php
- registerTypeConverter() : mixed
- Register a type converter by class name.
- resolveControllerAliasFromControllerClassName() : string
- actionCommaListToArray() : array<string, array<string|int, string>>
- checkExtensionNameFormat() : mixed
- Check a given extension name for validity.
- checkPluginNameFormat() : mixed
- Check a given plugin name for validity.
Constants
PLUGIN_TYPE_CONTENT_ELEMENT
public
mixed
PLUGIN_TYPE_CONTENT_ELEMENT
= 'CType'
PLUGIN_TYPE_PLUGIN
public
mixed
PLUGIN_TYPE_PLUGIN
= 'list_type'
Methods
configurePlugin()
Add auto-generated TypoScript to configure the Extbase Dispatcher.
public
static configurePlugin(string $extensionName, string $pluginName, array<string|int, mixed> $controllerActions[, array<string|int, mixed> $nonCacheableControllerActions = [] ][, string $pluginType = self::PLUGIN_TYPE_PLUGIN ]) : mixed
When adding a frontend plugin you will have to add both an entry to the TCA definition of tt_content table AND to the TypoScript template which must initiate the rendering. Including the plugin code after "defaultContentRendering" adds the necessary TypoScript for calling the appropriate controller and action of your plugin. FOR USE IN ext_localconf.php FILES Usage: 2
Parameters
- $extensionName : string
-
The extension name (in UpperCamelCase) or the extension key (in lower_underscore)
- $pluginName : string
-
must be a unique id for your plugin in UpperCamelCase (the string length of the extension key added to the length of the plugin name should be less than 32!)
- $controllerActions : array<string|int, mixed>
-
is an array of allowed combinations of controller and action stored in an array (controller name as key and a comma separated list of action names as value, the first controller and its first action is chosen as default)
- $nonCacheableControllerActions : array<string|int, mixed> = []
-
is an optional array of controller name and action names which should not be cached (array as defined in $controllerActions)
- $pluginType : string = self::PLUGIN_TYPE_PLUGIN
-
either \TYPO3\CMS\Extbase\Utility\ExtensionUtility::PLUGIN_TYPE_PLUGIN (default) or \TYPO3\CMS\Extbase\Utility\ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
Tags
registerControllerActions()
public
static registerControllerActions(string $extensionName, string $pluginName, array<string, array<string|int, string>> $controllerActions, array<string, array<string|int, string>> $nonCacheableControllerActions) : void
Parameters
- $extensionName : string
- $pluginName : string
- $controllerActions : array<string, array<string|int, string>>
- $nonCacheableControllerActions : array<string, array<string|int, string>>
registerModule()
To allow extension authors to support multiple versions, this method is kept until TYPO3 v13, but is no longer used nor evaluated from TYPO3 v12.0. To register modules, place the configuration in your extensions' Configuration/Backend/Modules.php file.
public
static registerModule(mixed $extensionName[, mixed $mainModuleName = '' ][, mixed $subModuleName = '' ][, mixed $position = '' ][, array<string|int, mixed> $controllerActions = [] ][, array<string|int, mixed> $moduleConfiguration = [] ]) : mixed
The functionality has been removed in v12. The method will be removed in TYPO3 v13.
The method deliberately does not throw a deprecation warning in order to keep the noise of deprecation warnings small.
Parameters
- $extensionName : mixed
- $mainModuleName : mixed = ''
- $subModuleName : mixed = ''
- $position : mixed = ''
- $controllerActions : array<string|int, mixed> = []
- $moduleConfiguration : array<string|int, mixed> = []
registerPlugin()
Register an Extbase PlugIn into backend's list of plugins FOR USE IN Configuration/TCA/Overrides/tt_content.php
public
static registerPlugin(string $extensionName, string $pluginName, string $pluginTitle[, string $pluginIcon = null ][, string $group = 'default' ][, string $pluginDescription = '' ]) : string
Parameters
- $extensionName : string
-
The extension name (in UpperCamelCase) or the extension key (in lower_underscore)
- $pluginName : string
-
must be a unique id for your plugin in UpperCamelCase (the string length of the extension key added to the length of the plugin name should be less than 32!)
- $pluginTitle : string
-
is a speaking title of the plugin that will be displayed in the drop down menu in the backend
- $pluginIcon : string = null
-
is an icon identifier or file path prepended with "EXT:", that will be displayed in the drop down menu in the backend (optional)
- $group : string = 'default'
-
add this plugin to a plugin group, should be something like "news" or the like, "default" as regular
- $pluginDescription : string = ''
-
additional description
Tags
Return values
stringregisterTypeConverter()
Register a type converter by class name.
public
static registerTypeConverter(string $typeConverterClassName) : mixed
will be removed in TYPO3 v13.0. Register type converters via Services.yaml in your extension(s).
Parameters
- $typeConverterClassName : string
resolveControllerAliasFromControllerClassName()
public
static resolveControllerAliasFromControllerClassName(string $controllerClassName) : string
Parameters
- $controllerClassName : string
only used for TYPO3 Core
Return values
stringactionCommaListToArray()
protected
static actionCommaListToArray(array<string, string|array<string|int, string>> $controllerActions) : array<string, array<string|int, string>>
Parameters
- $controllerActions : array<string, string|array<string|int, string>>
Return values
array<string, array<string|int, string>>checkExtensionNameFormat()
Check a given extension name for validity.
protected
static checkExtensionNameFormat(string $extensionName) : mixed
Parameters
- $extensionName : string
-
The name of the extension
Tags
checkPluginNameFormat()
Check a given plugin name for validity.
protected
static checkPluginNameFormat(string $pluginName) : mixed
Parameters
- $pluginName : string
-
The name of the plugin