‪TYPO3CMS  ‪main
TYPO3\CMS\Extbase\Utility\ExtensionUtility Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Utility\ExtensionUtility:
TYPO3\CMS\Extbase\Tests\Unit\Utility\Fixtures\ExtensionUtilityAccessibleProxy

Static Public Member Functions

static configurePlugin ($extensionName, $pluginName, array $controllerActions, array $nonCacheableControllerActions=[], $pluginType=self::PLUGIN_TYPE_PLUGIN)
 
static registerControllerActions (string $extensionName, string $pluginName, array $controllerActions, array $nonCacheableControllerActions)
 
static registerPlugin ($extensionName, $pluginName, $pluginTitle, $pluginIcon=null, $group='default', string $pluginDescription='')
 
static resolveControllerAliasFromControllerClassName (string $controllerClassName)
 

Public Attributes

const PLUGIN_TYPE_PLUGIN = 'list_type'
 
const PLUGIN_TYPE_CONTENT_ELEMENT = 'CType'
 

Detailed Description

Utilities to manage plugins and modules of an extension. Also useful to auto-generate the autoloader registry file ext_autoload.php.

Definition at line 26 of file ExtensionUtility.php.

Member Function Documentation

◆ configurePlugin()

static TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin (   $extensionName,
  $pluginName,
array  $controllerActions,
array  $nonCacheableControllerActions = [],
  $pluginType = self::PLUGIN_TYPE_PLUGIN 
)
static

Add auto-generated TypoScript to configure the Extbase Dispatcher.

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
string$extensionName‪The extension name (in UpperCamelCase) or the extension key (in lower_underscore)
string$pluginName‪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!)
array$controllerActions‪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)
array$nonCacheableControllerActions‪is an optional array of controller name and action names which should not be cached (array as defined in $controllerActions)
string$pluginType‪either \TYPO3\CMS\Extbase\Utility\ExtensionUtility::PLUGIN_TYPE_PLUGIN (default) or \TYPO3\CMS\Extbase\Utility\ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
Exceptions

Definition at line 48 of file ExtensionUtility.php.

References $GLOBALS, TYPO3\CMS\Core\Utility\ExtensionManagementUtility\addTypoScript(), TYPO3\CMS\Extbase\Utility\ExtensionUtility\PLUGIN_TYPE_CONTENT_ELEMENT, TYPO3\CMS\Extbase\Utility\ExtensionUtility\PLUGIN_TYPE_PLUGIN, and TYPO3\CMS\Extbase\Utility\ExtensionUtility\registerControllerActions().

Referenced by TYPO3\CMS\Extbase\Tests\Unit\Utility\ExtensionUtilityTest\configurePluginCreatesCorrectDefaultTypoScriptSetup(), TYPO3\CMS\Extbase\Tests\Unit\Utility\ExtensionUtilityTest\configurePluginRespectsDefaultActionAsANonCacheableAction(), TYPO3\CMS\Extbase\Tests\Unit\Utility\ExtensionUtilityTest\configurePluginRespectsNonDefaultActionAsANonCacheableAction(), TYPO3\CMS\Extbase\Tests\Unit\Utility\ExtensionUtilityTest\configurePluginThrowsExceptionIfExtensionNameIsEmpty(), TYPO3\CMS\Extbase\Tests\Unit\Utility\ExtensionUtilityTest\configurePluginThrowsExceptionIfPluginNameIsEmpty(), TYPO3\CMS\Extbase\Tests\Unit\Utility\ExtensionUtilityTest\configurePluginWorksForASingleControllerAction(), TYPO3\CMS\Extbase\Tests\Unit\Utility\ExtensionUtilityTest\configurePluginWorksForMinimalisticSetup(), TYPO3\CMS\Extbase\Tests\Unit\Utility\ExtensionUtilityTest\configurePluginWorksForMultipleControllerActionsAsArrayWithCacheableActionAsDefault(), TYPO3\CMS\Extbase\Tests\Unit\Utility\ExtensionUtilityTest\configurePluginWorksForMultipleControllerActionsWithCacheableActionAsDefault(), and TYPO3\CMS\Extbase\Tests\Unit\Utility\ExtensionUtilityTest\configurePluginWorksForMultipleControllerActionsWithNonCacheableActionAsDefault().

◆ registerControllerActions()

static TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerControllerActions ( string  $extensionName,
string  $pluginName,
array  $controllerActions,
array  $nonCacheableControllerActions 
)
static
Parameters
array<string,string[]>‪$controllerActions
array<string,string[]>‪$nonCacheableControllerActions

Definition at line 96 of file ExtensionUtility.php.

References $GLOBALS, and TYPO3\CMS\Extbase\Utility\ExtensionUtility\resolveControllerAliasFromControllerClassName().

Referenced by TYPO3\CMS\Extbase\Utility\ExtensionUtility\configurePlugin().

◆ registerPlugin()

static TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin (   $extensionName,
  $pluginName,
  $pluginTitle,
  $pluginIcon = null,
  $group = 'default',
string  $pluginDescription = '' 
)
static

Register an Extbase PlugIn into backend's list of plugins FOR USE IN Configuration/TCA/Overrides/tt_content.php

Parameters
string$extensionName‪The extension name (in UpperCamelCase) or the extension key (in lower_underscore)
string$pluginName‪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!)
string$pluginTitle‪is a speaking title of the plugin that will be displayed in the drop down menu in the backend
string$pluginIcon‪is an icon identifier or file path prepended with "EXT:", that will be displayed in the drop down menu in the backend (optional)
string$group‪add this plugin to a plugin group, should be something like "news" or the like, "default" as regular
string$pluginDescription‪additional description
Exceptions

Definition at line 129 of file ExtensionUtility.php.

References $GLOBALS, TYPO3\CMS\Core\Utility\ExtensionManagementUtility\addPlugin(), and TYPO3\CMS\Core\Utility\GeneralUtility\camelCaseToLowerCaseUnderscored().

Referenced by TYPO3\CMS\Extbase\Tests\Unit\Utility\ExtensionUtilityTest\registerPluginMethodReturnsPluginSignature(), TYPO3\CMS\Extbase\Tests\Unit\Utility\ExtensionUtilityTest\registerPluginTriggersAddPluginWhichSetsPluginIconPathIfIconPathIsGiven(), TYPO3\CMS\Extbase\Tests\Unit\Utility\ExtensionUtilityTest\registerPluginTriggersAddPluginWhichSetsPluginIconPathIfUsingUnderscoredExtensionNameAndIconPathNotGiven(), and TYPO3\CMS\Extbase\Tests\Unit\Utility\ExtensionUtilityTest\registerPluginTriggersAddPluginWhichSetsPluginIconPathIfUsingUpperCameCasedExtensionNameAndIconPathNotGiven().

◆ resolveControllerAliasFromControllerClassName()

static TYPO3\CMS\Extbase\Utility\ExtensionUtility::resolveControllerAliasFromControllerClassName ( string  $controllerClassName)
static

Member Data Documentation

◆ PLUGIN_TYPE_CONTENT_ELEMENT

const TYPO3\CMS\Extbase\Utility\ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT = 'CType'

◆ PLUGIN_TYPE_PLUGIN

const TYPO3\CMS\Extbase\Utility\ExtensionUtility::PLUGIN_TYPE_PLUGIN = 'list_type'