Fluid
Fluid copied to clipboard
f:contains ViewHelper
A new <f:contains> ViewHelper should be added to Fluid, which checks if a provided value either exists in the provided array or in the provided string. If both the array and the string are provided, an exception should be thrown. This ViewHelper should extend the AbstractConditionViewHelper.
Arguments:
- mixed $value (needs to be scalar if f:contains is used with the string argument)
- array $array
- string $string
See also the php in_array() and the php str_contains() functions.
Examples:
<f:contains value="foo" array="{myArray}">
</f:contains>
<f:contains value="foo" string="{myString}">
</f:contains>
<f:variable name="result" value="{f:contains(value: 'foo', array: myArray)}" />