我有以下模板:
<f:for each="{matchday.matches}" as="match" iteration="matchIterator">
<f:if condition="{match.home_team._id} == {team}">
<f:render section="match" arguments="{match: match, is_home: 1, round_number: matchday.round_number}" />
</f:if>
<f:if condition="{match.away_team._id} == {team}">
<f:render section="match" arguments="{match: match, is_home: 0, round_number: matchday.round_number}" />
</f:if>
所有条目均按 Id 排序。比赛有一个属性play_date包含比赛的正确日期。
如何在输出前按日期对数组进行排序?
我已经尝试过使用 SortViewHelper 但它没有用:
<f:for each="{matchday.matches->v:iterator.sort(order: 'ASC', sortBy:'play_date')}" as="match" iteration="matchIterator">