Fluid
Fluid copied to clipboard
f:startsWith and f:endsWith ViewHelpers
Two new ViewHelpers <f:startsWith> and <f:endsWith> should be added to Fluid. <f:startsWith> checks if the subject string starts with a specified string. <f:endsWith> checks if the subject string ends with a specified string. These ViewHelpers should extend the AbstractConditionViewHelper.
Arguments:
- string $search
- string $subject
See also the php str_starts_with() and the php str_ends_with() functions.
Example:
<f:startsWith search="Hello" subject="Hello World">
</f:startsWith>
<f:endsWith search="World" subject="Hello World">
</f:endsWith>
<f:variable name="result" value="{myVariable -> f:startsWith(search: 'Hello')}" />