[FEATURE] Add IsEmptyViewHelper

This commit is contained in:
Philipp Dieter 2022-08-24 16:43:03 +02:00
parent 53ac1436db
commit c83cb2622a

View File

@ -0,0 +1,20 @@
<?php
namespace Cjel\TemplatesAide\ViewHelpers;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
class IsEmptyViewHelper extends AbstractViewHelper
{
public static function renderStatic(
array $arguments,
\Closure $renderChildrenClosure,
RenderingContextInterface $renderingContext
) {
if (empty($renderChildrenClosure())) {
return true;
}
return false;
}
}