TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Fluid\ViewHelpers\CountViewHelper Class Reference
Inheritance diagram for TYPO3\CMS\Fluid\ViewHelpers\CountViewHelper:
TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper Tx_Fluid_ViewHelpers_CountViewHelper

Public Member Functions

 render ($subject=NULL)
 
- Public Member Functions inherited from TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
 setArguments (array $arguments)
 
 setRenderingContext (\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 
 injectReflectionService (\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService)
 
 isEscapingInterceptorEnabled ()
 
 setViewHelperNode (\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode $node)
 
 setRenderChildrenClosure (\Closure $renderChildrenClosure)
 
 initializeArgumentsAndRender ()
 
 initialize ()
 
 renderChildren ()
 
 prepareArguments ()
 
 validateArguments ()
 
 initializeArguments ()
 
 compile ($argumentsVariableName, $renderChildrenClosureVariableName, &$initializationPhpCode, \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $syntaxTreeNode, \TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler $templateCompiler)
 
 resetState ()
 

Protected Attributes

 $escapingInterceptorEnabled = FALSE
 
- Protected Attributes inherited from TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
 $arguments
 
 $templateVariableContainer
 
 $controllerContext
 
 $renderingContext
 
 $renderChildrenClosure = NULL
 
 $viewHelperVariableContainer
 
 $objectManager
 
 $escapingInterceptorEnabled = TRUE
 

Additional Inherited Members

- Static Public Member Functions inherited from TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
static renderStatic (array $arguments, \Closure $renderChildrenClosure, \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 
- Protected Member Functions inherited from TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
 registerArgument ($name, $type, $description, $required=FALSE, $defaultValue=NULL)
 
 overrideArgument ($name, $type, $description, $required=FALSE, $defaultValue=NULL)
 
 callRenderMethod ()
 
 buildRenderChildrenClosure ()
 
 hasArgument ($argumentName)
 

Detailed Description

This ViewHelper counts elements of the specified array or countable object.

= Examples =

<f:count subject="{0:1, 1:2, 2:3, 3:4}" /> <output> 4 </output>

{objects -> f:count()} <output> 10 (depending on the number of items in {objects}) </output>

Definition at line 35 of file CountViewHelper.php.

Member Function Documentation

◆ render()

TYPO3\CMS\Fluid\ViewHelpers\CountViewHelper::render (   $subject = NULL)

Counts the items of a given property.

Parameters
array$subjectThe array or to be counted
Returns
integer The number of elements
Exceptions

Definition at line 50 of file CountViewHelper.php.

References TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper\renderChildren().

Member Data Documentation

◆ $escapingInterceptorEnabled

TYPO3\CMS\Fluid\ViewHelpers\CountViewHelper::$escapingInterceptorEnabled = FALSE
protected

Definition at line 40 of file CountViewHelper.php.