| Current Path : /var/www/surf/TYPO3/vendor/b13/container/Classes/ViewHelpers/ |
| Current File : /var/www/surf/TYPO3/vendor/b13/container/Classes/ViewHelpers/DrawChildrenViewHelper.php |
<?php
declare(strict_types=1);
namespace B13\Container\ViewHelpers;
/*
* This file is part of TYPO3 CMS-based extension "container" by b13.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*/
use B13\Container\View\ContainerLayoutView;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
class DrawChildrenViewHelper extends AbstractViewHelper
{
use CompileWithRenderStatic;
/**
* @var bool
*/
protected $escapeOutput = false;
public function initializeArguments()
{
parent::initializeArguments();
$this->registerArgument('uid', 'int', 'Uid of Container Record', true);
$this->registerArgument('colPos', 'int', 'colPos to fetch', true);
}
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext): string
{
$containerLayoutView = GeneralUtility::makeInstance(ContainerLayoutView::class);
$content = $containerLayoutView->renderContainerChildren((int)$arguments['uid'], (int)$arguments['colPos']);
return $content;
}
}