我有以下模板:
<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">