Documentation · ViewHelper reference

XSD schema file | vhs master

Iterator / FilterViewHelper

Iterator: Filter ViewHelper

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. /

  • Tag usage example

    <v:iterator.filter subject="[mixed]" filter="[mixed]" propertyName="NULL" preserveKeys="1" invert="1" nullFilter="1">
    	<!-- tag content - may be ignored! -->
  • Inline usage example

    {v:iterator.filter(subject: [mixed], filter: [mixed], propertyName: 'NULL', preserveKeys: 1, invert: 1, nullFilter: 1)}


Argument Description Type

The comparison value


Invert the behavior of the filtering


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


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


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


The subject iterator/array to be filtered

Required attribute

Revision history

commit e48bb73768abd2a838f423a7799b0e6c75180e83
Author: Claus Due <*****>
Date:   Tue Nov 5 23:47:59 2013 +0100

    [FEATURE] Iterator / Filter ViewHelper
    Selects values or objects with properties matching a given filter.

commit f76b99d1d06c9468f48c399543dcc3f34048efe8
Author: Claus Due <*****>
Date:   Thu Nov 7 12:45:16 2013 +0100

    [TASK] Fix CGL issue in Iterator / Filter ViewHelper

commit f9faca970f0d537242651764bdf44734abafa187
Author: Björn Fromme <*****>
Date:   Mon Dec 16 17:51:09 2013 +0100

    [TASK] Refactor class inheritance

commit da31bad1d9bb058c072ddb5591e8ed907a1ae8e1
Author: Claus Due <*****>
Date:   Tue Dec 31 23:08:37 2013 +0100

    [TASK] Happy new year!

commit d2e531da034976e6db1478eef5a8478595fd16fe
Author: Claus Due <*****>
Date:   Sun Jan 5 00:45:10 2014 +0100

    [TASK] Migrate to using namespace core class names

commit 1d6bb96fe95d3bc879626a6e6a040db5a691239d
Author: Cedric Ziel <*****>
Date:   Fri Feb 28 09:47:47 2014 +0100

    [BUGFIX] Allow for filter value 0
    Fixes #480

commit da7677bc74f14e9a9300e4ba4487e52c3cb97642
Author: Claus Due <*****>
Date:   Sun Apr 20 01:13:33 2014 +0200

    [TASK] Switch to namespaces

commit 468134cf8a14edc3402dc97a098f5d97072eea09
Author: Stefano Kowalke <*****>
Date:   Fri Sep 26 14:49:04 2014 +0200

    [FEATURE] Add option to invert the FilterViewHelper
    This change inverts the behavior of the viewhelper. Now the filtered element is removed from the array.

commit 8bb2fc5ee124ba19b0a0ab8e061c9a153fc4651f
Author: Xaver Maierhofer <*****>
Date:   Sun Jan 18 17:56:13 2015 +0100

    [TASK] Reference Copyright to file