Skip to content

Conversation

@s2b
Copy link
Contributor

@s2b s2b commented Aug 17, 2025

Two new ViewHelpers <f:startsWith> and <f:endsWith> are 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 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')}" />

Resolves: #1126

Two new ViewHelpers `<f:startsWith>` and `<f:endsWith>` are 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 extend the AbstractConditionViewHelper.

Arguments:

string $search
string $subject
See also [the php str_starts_with()](https://www.php.net/manual/en/function.str-starts-with.php) and [the php str_ends_with()](https://www.php.net/manual/en/function.str-ends-with.php) 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')}" />
```

Resolves: #1126
@s2b s2b merged commit 022b5a0 into 4.5 Aug 17, 2025
10 checks passed
@s2b s2b deleted the backport branch August 17, 2025 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants