2 declare(strict_types = 1);
21 use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
22 use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
23 use TYPO3Fluid\Fluid\Core\ViewHelper\Exception;
24 use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
33 use CompileWithRenderStatic;
42 $this->registerArgument(
'element', RootRenderableInterface::class,
'Form Element to translate',
true);
43 $this->registerArgument(
'property',
'mixed',
'Property to translate',
false);
44 $this->registerArgument(
'renderingOptionProperty',
'mixed',
'Property to translate',
false);
55 public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
57 static::assertArgumentTypes($arguments);
59 $element = $arguments[
'element'];
62 if (!empty($arguments[
'property'])) {
63 $property = $arguments[
'property'];
64 } elseif (!empty($arguments[
'renderingOptionProperty'])) {
65 $property = $arguments[
'renderingOptionProperty'];
68 if (empty($property)) {
70 } elseif (is_array($property)) {
71 $propertyParts = $property;
73 $propertyParts = [$property];
77 $formRuntime = $renderingContext
78 ->getViewHelperVariableContainer()
79 ->get(RenderRenderableViewHelper::class,
'formRuntime');
89 foreach ([
'property',
'renderingOptionProperty'] as $argumentName) {
91 !isset($arguments[$argumentName])
92 || is_string($arguments[$argumentName])
93 || is_array($arguments[$argumentName])
99 'Arguments "%s" either must be string or array',