for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Qbus\Qbtools\ViewHelpers;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
/**
* WrapViewHelper
*
* @author Benjamin Franzke <[email protected]>
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
*/
class WrapViewHelper extends AbstractViewHelper
{
use CompileWithRenderStatic;
* @var bool
protected $escapeOutput = false;
* Initialize arguments
public function initializeArguments()
$this->registerArgument('class', 'string', '', true);
}
* @param array $arguments
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
* @return string
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
$class = $arguments['class'];
$content = $renderChildrenClosure();
if (ctype_space($content) || $content === '' || $content === null) {
return '';
return '<div class="' . htmlspecialchars($class) . '">' . $content . '</div>';