[FEATURE] Add IsEmptyViewHelper
This commit is contained in:
parent
53ac1436db
commit
c83cb2622a
20
Classes/ViewHelpers/IsEmptyViewHelper.php
Normal file
20
Classes/ViewHelpers/IsEmptyViewHelper.php
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user