Package

ViewHelpers

ViewHelper Documentation

v:iterator.sort

Sorts an instance of ObjectStorage, an Iterator implementation, an Array or a QueryResult (including Lazy counterparts).

Can be used inline, i.e.:

<f:for each="{dataset -> vhs:iterator.sort(sortBy: 'name')}" as="item">
    // iterating data which is ONLY sorted while rendering this particular loop
</f:for>

Arguments

as string

Template variable name to assign; if not specified the ViewHelper returns the variable instead.

subject anySimpleType

The array/Traversable instance to sort

sortBy string

Which property/field to sort by - leave out for numeric sorting based on indexes(keys)

order string

ASC, DESC, RAND or SHUFFLE. RAND preserves keys, SHUFFLE does not - but SHUFFLE is faster

sortFlags string

Constant name from PHP for `SORT_FLAGS`: `SORT_REGULAR`, `SORT_STRING`, `SORT_NUMERIC`, `SORT_NATURAL`, `SORT_LOCALE_STRING` or `SORT_FLAG_CASE`. You can provide a comma seperated list or array to use a combination of flags.

ViewHelper Resources

Schema Resources