-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Matthias Richter
committed
Dec 4, 2024
1 parent
bea92d4
commit eac067d
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
declare(strict_types=1); | ||
namespace Slub\LisztBibliography\ViewHelpers; | ||
|
||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; | ||
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper; | ||
|
||
final class TranslateViewHelper extends AbstractViewHelper | ||
{ | ||
public function initializeArguments(): void | ||
{ | ||
$this->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']); | ||
} | ||
} |