![]() |
TYPO3
7.6
|
Static Public Member Functions | |
static | renderStatic (array $arguments,\Closure $renderChildrenClosure,\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext) |
![]() | |
static | renderStatic (array $arguments,\Closure $renderChildrenClosure,\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext) |
![]() | |
static | renderStatic (array $arguments,\Closure $renderChildrenClosure,\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext) |
Additional Inherited Members | |
![]() | |
registerArgument ($name, $type, $description, $required=false, $defaultValue=null) | |
overrideArgument ($name, $type, $description, $required=false, $defaultValue=null) | |
callRenderMethod () | |
getLogger () | |
buildRenderChildrenClosure () | |
hasArgument ($argumentName) | |
![]() | |
$arguments | |
$templateVariableContainer | |
$controllerContext | |
$renderingContext | |
$renderChildrenClosure = null | |
$viewHelperVariableContainer | |
$objectManager | |
$escapingInterceptorEnabled = true | |
Loop view helper which can be used to interate over array. Implements what a basic foreach()-PHP-method does.
= Examples =
<f:for each="{0:1, 1:2, 2:3, 3:4}" as="foo">{foo}</f:for>
<output> 1234 </output>
f:for each="{fruit1: 'apple', fruit2: 'pear', fruit3: 'banana', fruit4: 'cherry'}" as="fruit" key="label"> {label}: {fruit} </f:for> <output>
</output>
f:for each="{0:1, 1:2, 2:3, 3:4}" as="foo" iteration="fooIterator"> Index: {fooIterator.index} Cycle: {fooIterator.cycle} Total: {fooIterator.total}{f:if(condition: fooIterator.isEven, then: ' Even')}{f:if(condition: fooIterator.isOdd, then: ' Odd')}{f:if(condition: fooIterator.isFirst, then: ' First')}{f:if(condition: fooIterator.isLast, then: ' Last')} </f:for> <output>
</output>
Definition at line 61 of file ForViewHelper.php.
render | ( | $each, | |
$as, | |||
$key = '' , |
|||
$reverse = false , |
|||
$iteration = null |
|||
) |
Iterates through elements of $each and renders child nodes
array | $each | The array or to iterated over |
string | $as | The name of the iteration variable |
string | $key | The name of the variable to store the current array key |
bool | $reverse | If enabled, the iterator will start with the last element and proceed reversely |
string | $iteration | The name of the variable to store iteration information (index, cycle, isFirst, isLast, isEven, isOdd) |
Definition at line 74 of file ForViewHelper.php.
References AbstractViewHelper\buildRenderChildrenClosure().
|
static |
array | $arguments | |
\Closure | $renderChildrenClosure | |
\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface | $renderingContext |
\TYPO3\CMS\Fluid\Core\ViewHelper\Exception |
Definition at line 90 of file ForViewHelper.php.
References AbstractViewHelper\$renderChildrenClosure, and AbstractViewHelper\$templateVariableContainer.