condition.iterator.contains

Condition ViewHelper. Renders the then-child if Iterator/array haystack contains needle value.

Example:

{v:condition.iterator.contains(needle: 'foo', haystack: {0: 'foo'}, then: 'yes', else: 'no')}

Arguments

then

DataType

mixed

Required

false

Description

Value to be returned if the condition if met.

else

DataType

mixed

Required

false

Description

Value to be returned if the condition if not met.

needle

DataType

mixed

Required

true

Description

Needle to search for in haystack

haystack

DataType

mixed

Required

true

Description

Haystack in which to look for needle

considerKeys

DataType

boolean

Required

false

Description

Tell whether to consider keys in the search assuming haystack is an array.