[FEATURE] Add DotsToBracketsViewHelper
This commit is contained in:
parent
5a435098dd
commit
0109796bc6
21
Classes/ViewHelpers/DotsToBracketsViewHelper.php
Normal file
21
Classes/ViewHelpers/DotsToBracketsViewHelper.php
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<?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 DotsToBracketsViewHelper extends AbstractViewHelper
|
||||||
|
{
|
||||||
|
public static function renderStatic(
|
||||||
|
array $arguments,
|
||||||
|
\Closure $renderChildrenClosure,
|
||||||
|
RenderingContextInterface $renderingContext
|
||||||
|
) {
|
||||||
|
$parts = explode('.', $renderChildrenClosure());
|
||||||
|
$_ = '[\'';
|
||||||
|
$_ .= implode('\'][\'', $parts);
|
||||||
|
$_ .= '\']';
|
||||||
|
return $_;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user