Mar*_*tin 2 typo3 fluid typo3-7.6.x
我values在动作控制器中为视图指定了一个关联数组.
<f:debug>{values}</f:debug> 输出以下内容,表示数据在视图中.
array (3 items)
63 => 158 (integer)
49 => 0 (integer)
164 => 0 (integer)
Run Code Online (Sandbox Code Playgroud)
在我的流体模板中,我对一些项目进行了循环.在该循环中,我使用f:form.select viewhelper创建选择字段.表单没有绑定到对象,我不能使用属性参数.但我想反映每个选择字段的当前(最后选择的)值.
每个选择都被命名filter_{loopItem.uid}.
<f:debug>{values.63}</f:debug>输出158 (integer)也是正确的.如果我value={values.63}在f:form.select viewhelper的value参数中设置,则在filter_63中选择相应的选项.
我想要做的是使用uid作为filters数组的索引,以便我可以编写类似的东西value={values.{loopItem.uid}},select选择相应的选项.但这不起作用,调试输出NULL.
具有常数63的{值63}正常工作.即使使用{values.index}映射{index:loopItem.uid}的别名也会导致NULL.
如何使用基于loopItem.uid的变量值替换固定的63?
| 归档时间: |
|
| 查看次数: |
4140 次 |
| 最近记录: |