From ebf5f204cd9842852c9b5f14287b50ec74686672 Mon Sep 17 00:00:00 2001 From: Lina Wolf <48202465+linawolf@users.noreply.github.com> Date: Tue, 9 May 2023 06:11:25 +0200 Subject: [PATCH] [TASK] Cleanup ext_localconf.php (#833) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After dropping TYPO3 10.4 support: - Using an anonymous function is not needed anymore - declare(strict_types=1); can and should be used - Use statements instead of FQCN should be used resolves https://github.com/TYPO3-Documentation/tea/issues/826 --------- Co-authored-by: Chris Müller <2566282+brotkrueml@users.noreply.github.com> --- ext_localconf.php | 57 +++++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/ext_localconf.php b/ext_localconf.php index 5dad551..74d7164 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -1,31 +1,34 @@ 'index', - ], - // non-cacheable actions - [ - \TTN\Tea\Controller\TeaController::class => '', - ] - ); - \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( - 'Tea', - 'TeaShow', - [ - \TTN\Tea\Controller\TeaController::class => 'show', - ], - [ - \TTN\Tea\Controller\TeaController::class => '', - ] - ); -})(); +// This makes the plugin available for front-end rendering. +ExtensionUtility::configurePlugin( + // extension name, matching the PHP namespaces (but without the vendor) + 'Tea', + // arbitrary, but unique plugin name (not visible in the BE) + 'TeaIndex', + // all actions + [ + TeaController::class => 'index', + ], + // non-cacheable actions + [ + TeaController::class => '', + ] +); +ExtensionUtility::configurePlugin( + 'Tea', + 'TeaShow', + [ + TeaController::class => 'show', + ], + [ + TeaController::class => '', + ] +);