From eac067d7f0313fb968e9e1ac982be15254b7749f Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Wed, 4 Dec 2024 10:06:55 +0100 Subject: [PATCH] Add TranslateViewHelper --- Classes/ViewHelpers/TranslateViewHelper.php | 27 +++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Classes/ViewHelpers/TranslateViewHelper.php diff --git a/Classes/ViewHelpers/TranslateViewHelper.php b/Classes/ViewHelpers/TranslateViewHelper.php new file mode 100644 index 0000000..e177734 --- /dev/null +++ b/Classes/ViewHelpers/TranslateViewHelper.php @@ -0,0 +1,27 @@ +registerArgument('key', 'string', 'the key wich has to be translated', true); + } + + public static function renderStatic( + array $arguments, + \Closure $renderChildrenClosure, + RenderingContextInterface $renderingContext) + : ?array + { + $extConf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('liszt_bibliography'); + + return GeneralUtility::makeInstanceService(SearchService::class)-> + get($arguments['key'], $extConf['elasticLocaleIndexName']); + } +}