TYPO3 / Fluid

Fluid template rendering engine - Standalone version
GNU Lesser General Public License v3.0
151 stars 93 forks source link

[FEATURE] ViewHelpers to return first/last item of an array #866

Closed s2b closed 4 months ago

s2b commented 4 months ago

The FirstViewHelper and LastViewHelper return the first or last item of a specified array, respectively.

Examples

<f:first value="{0: 'first', 1: 'second', 2: 'third'}" /> <!-- Outputs "first" -->
<f:last value="{0: 'first', 1: 'second', 2: 'third'}" /> <!-- Outputs "third" -->