iterator.filter ViewHelper <vhs:iterator.filter>

Iterator: Filter ViewHelper

Filters an array by filtering the array, analysing each member and asserting 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.

Arguments

subject

DataType

mixed

Required

false

Description

The subject iterator/array to be filtered

filter

DataType

mixed

Required

false

Description

The comparison value

propertyName

DataType

string

Required

false

Description

Optional property name to extract and use for comparison instead of the object; use on ObjectStorage etc. Note: supports dot-path expressions

preserveKeys

DataType

boolean

Required

false

Description

If TRUE, keys in the array are preserved - even if they are numeric

invert

DataType

boolean

Required

false

Description

Invert the behavior of the filtering

nullFilter

DataType

boolean

Required

false

Description

If TRUE and $filter is NULL (not set) includes only NULL values. Useful with $invert.