Skip to content

Commit

Permalink
[DOCS] Correct Changelog for ExtensionUtility::configurePlugin
Browse files Browse the repository at this point in the history
The 5th parameter of ExtensionUtility::registerPlugin is thegroup and not `ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT`

Fixes the name to the correct function and adds example code.

Resolves: #101575
Releases: main, 12.4, 11.5
Change-Id: I05a344ee11aaa8a9b3187a11528e2e506f47756d
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80355
Tested-by: core-ci <typo3@b13.com>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
  • Loading branch information
linawolf authored and lolli42 committed Aug 4, 2023
1 parent 7679a2e commit d01a03b
Showing 1 changed file with 26 additions and 2 deletions.
Expand Up @@ -13,7 +13,7 @@ Description

Due to the deprecation of Switchable Controller Actions for Extbase, it is
recommended to use custom content types as plugins. When using Extbase's API
:php:`\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin()` with
:php:`\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin()` with
the 5th argument being set to
:php:`\TYPO3\CMS\Extbase\Utility\ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT`
or TYPO3's native API :php:`\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin()`
Expand All @@ -39,7 +39,8 @@ Example
Example for a custom Extbase plugin with TYPO3's Core "felogin" extension
in `EXT:felogin/Configuration/TCA/Overrides/tt_content.php`:

.. code-block:: php
.. code-block:: php
:caption: EXT:felogin/Configuration/TCA/Overrides/tt_content.php
call_user_func(static function () {
$contentTypeName = 'felogin_login';
Expand Down Expand Up @@ -67,4 +68,27 @@ in `EXT:felogin/Configuration/TCA/Overrides/tt_content.php`:
);
});
It is configured to be a content element with its own ctype by having the 5th
parameter set to :php:`ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT`.

.. code-block:: php
:caption: EXT:felogin/ext_localconf.php
:emphasize-lines: 14
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
ExtensionUtility::configurePlugin(
'Felogin',
'Login',
[
LoginController::class => 'login, overview',
PasswordRecoveryController::class => 'recovery,showChangePassword,changePassword',
],
[
LoginController::class => 'login, overview',
PasswordRecoveryController::class => 'recovery,showChangePassword,changePassword',
],
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
);
.. index:: Backend, TCA, ext:core

0 comments on commit d01a03b

Please sign in to comment.