initializeArguments())") */ public function introduceRenderFuncArgument(JoinPointInterface $joinPoint): void { $proxy = $joinPoint->getProxy(); if (!($proxy instanceof TextfieldViewHelper)) { return; } $proxy->registerArgument('renderFunction', 'string', 'callabe to use to render single object'); } /** * @Flow\Around("setting(DigiComp.FluidRenderFunctions.enableAspects.textfield) && method(Neos\FluidAdaptor\ViewHelpers\Form\TextfieldViewHelper->getValueAttribute())") */ public function applyRenderFunctionToValue(JoinPointInterface $joinPoint) { $proxy = $joinPoint->getProxy(); if (!($proxy instanceof TextfieldViewHelper)) { return; } if (!isset($proxy->arguments['renderFunction'])) { return $joinPoint->getAdviceChain()->proceed($joinPoint); } $renderFunction = $proxy->viewHelperVariableContainer->get( RegisterRenderFunctionViewHelper::class, $proxy->arguments['renderFunction'] ); if (!($renderFunction instanceof InvokeRenderFunctionInterface)) { throw new \InvalidArgumentException( 'render function with name "' . $proxy->arguments['renderFunction'] . '" has not been registered.', 1717293038 ); } $originalObject = $joinPoint->getAdviceChain()->proceed($joinPoint); if (\is_object($originalObject)) { return new RenderableProxy($renderFunction, $originalObject); } return $originalObject; } }