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
registerPlugin()  : string
Register an Extbase PlugIn into backend's list of plugins FOR USE IN Configuration/TCA/Overrides/tt_content.php
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
throws
InvalidArgumentException

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>>
Internal

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
throws
InvalidArgumentException
Return values
string

resolveControllerAliasFromControllerClassName()

public static resolveControllerAliasFromControllerClassName(string $controllerClassName) : string
Parameters
$controllerClassName : string
Internal

only used for TYPO3 Core

Return values
string

actionCommaListToArray()

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
throws
InvalidArgumentException

checkPluginNameFormat()

Check a given plugin name for validity.

protected static checkPluginNameFormat(string $pluginName) : mixed
Parameters
$pluginName : string

The name of the plugin

Tags
throws
InvalidArgumentException

        
On this page

Search results