wit*_*rin 1 fluid view-helpers
我想f:for通过使用其内联表示法在TYPO3 Fluid模板中使用loop()填充属性值:
<div class="one two three">[...]</div>
Run Code Online (Sandbox Code Playgroud)
有谁知道怎么做?
与此同时,我找到了解决问题的方法.要打印阵列中的所有项目,您可以执行类似的操作{x -> f:for(each: {0: 'one', 1: 'two', 2: 'three'}, as: 'x')}.但这会导致:onetwothree.要修复视图助手f:if帮助:
<div class="{f:if(condition: i.isLast, then: '{x}', else: '{x} ')
-> f:for(each: {0: 'one', 1: 'two', 2: 'three'}, as: 'x', iteration: 'i')}">
[...]
</div>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3827 次 |
| 最近记录: |