diff --git a/typo3/sysext/fluid/Classes/Core/Widget/AbstractWidgetViewHelper.php b/typo3/sysext/fluid/Classes/Core/Widget/AbstractWidgetViewHelper.php index 3c969cc5ce6600b6b959810808bdd89e06916d90..21574e5997f7984d3b1a74f4403b5bb05427c08b 100644 --- a/typo3/sysext/fluid/Classes/Core/Widget/AbstractWidgetViewHelper.php +++ b/typo3/sysext/fluid/Classes/Core/Widget/AbstractWidgetViewHelper.php @@ -14,8 +14,10 @@ namespace TYPO3\CMS\Fluid\Core\Widget; * The TYPO3 project - inspiring people to share! */ +use TYPO3Fluid\Fluid\Component\ComponentInterface; use TYPO3Fluid\Fluid\Core\Compiler\TemplateCompiler; use TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\ViewHelperNode; +use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper; abstract class AbstractWidgetViewHelper extends AbstractViewHelper @@ -124,6 +126,38 @@ abstract class AbstractWidgetViewHelper extends AbstractViewHelper return $this->callRenderMethod(); } + /** + * Initialize the arguments of the ViewHelper, and call the render() method of the ViewHelper. + * + * @param RenderingContextInterface $renderingContext + * @return string the rendered ViewHelper. + * @internal + */ + public function evaluate(RenderingContextInterface $renderingContext) + { + $this->renderingContext = $renderingContext; + $this->getArguments()->setRenderingContext($renderingContext); + $this->initializeWidgetContext(); + return $this->callRenderMethod(); + } + + /** + * Stores the syntax tree child nodes in the Widget Context, so they can be + * rendered with <f:widget.renderChildren> lateron. + * + * @param RenderingContextInterface $renderingContext + * @return ComponentInterface + * @internal + */ + public function onClose(RenderingContextInterface $renderingContext): ComponentInterface + { + $node = parent::onClose($renderingContext); + $rootNode = $this->objectManager->get(\TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\RootNode::class); + $rootNode->setChildren($this->getChildren()); + $this->widgetContext->setViewHelperChildNodes($rootNode, $renderingContext); + return $node; + } + /** * Initialize the Widget Context, before the Render method is called. */