PHP Class FluidTYPO3\Vhs\ViewHelpers\Iterator\UniqueViewHelper

Implementation of array_unique for Fluid Accepts an input array of values and returns/assigns a new array containing only the unique values found in the input array. Note that the ViewHelper does not support the sorting parameter - if you wish to sort the result you should use v:iterator.sort in a chain. #### Usage examples xml Countries of our users: {userCountries -> v:iterator.unique() -> v:iterator.implode(glue: ' - ')} Output: xml Countries of our users: USA - USA - Denmark - Germany - Germany - USA - Denmark - Germany xml Countries of our users, in alphabetical order: {userCountries -> v:iterator.unique() -> v:iterator.sort(sortFlags: 'SORT_NATURAL') -> v:iterator.implode(glue: ' - ')} Output: xml Countries of our users: Denmark - Germany - USA
Inheritance: extends TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper, use trait FluidTYPO3\Vhs\Traits\TemplateVariableViewHelperTrait, use trait FluidTYPO3\Vhs\Traits\ArrayConsumingViewHelperTrait
显示文件 Open project: fluidtypo3/vhs

Public Methods

Method Description
initializeArguments ( ) : void Initialize arguments
render ( ) : mixed

Method Details

initializeArguments() public method

Initialize arguments
public initializeArguments ( ) : void
return void

render() public method

public render ( ) : mixed
return mixed