PHP Class FluidTYPO3\Vhs\ViewHelpers\Iterator\FilterViewHelper

Filters an array by filtering the array, analysing each member and assering if it is equal to (weak type) the filter parameter. If propertyName is set, the ViewHelper will try to extract this property from each member of the array. Iterators and ObjectStorage etc. are supported.
Author: Claus Due ([email protected])
Inheritance: extends TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
Datei anzeigen Open project: fluidtypo3/vhs

Public Methods

Method Description
render ( mixed $subject = null, mixed $filter = null, string $propertyName = null, boolean $preserveKeys = false, boolean $invert = false, boolean $nullFilter = false ) : mixed Render method

Protected Methods

Method Description
filter ( mixed $item, mixed $filter, string $propertyName ) : boolean Filter an item/value according to desired filter. Returns TRUE if the item should be included, FALSE otherwise. This default method simply does a weak comparison (==) for sameness.

Method Details

filter() protected method

Filter an item/value according to desired filter. Returns TRUE if the item should be included, FALSE otherwise. This default method simply does a weak comparison (==) for sameness.
protected filter ( mixed $item, mixed $filter, string $propertyName ) : boolean
$item mixed
$filter mixed Could be a single value or an Array. If so the function returns TRUE when $item matches with any value in it.
$propertyName string
return boolean

render() public method

Render method
public render ( mixed $subject = null, mixed $filter = null, string $propertyName = null, boolean $preserveKeys = false, boolean $invert = false, boolean $nullFilter = false ) : mixed
$subject mixed The subject iterator/array to be filtered
$filter mixed The comparison value
$propertyName string Optional property name to extract and use for comparison instead of the object; use on ObjectStorage etc. Note: supports dot-path expressions.
$preserveKeys boolean If TRUE, keys in the array are preserved - even if they are numeric
$invert boolean Invert the behavior of the view helper
$nullFilter boolean If TRUE and $filter is NULL (not set) - to filter NULL or empty values
return mixed