【发布时间】:2013-04-09 07:08:27
【问题描述】:
为了访问在 html 页面上的 php 脚本中创建的数组,我们这样做{{@somearray['somevalue']}}。
我们如何处理从其他数组{{@someotherarray['someotherindex'}}获取密钥('somevalue')的情况
(即{{@someotherarray['someotherindex']}} = somevalue 的值)?
我使用的是 F3 版本 2.1.x。
【问题讨论】:
-
只是猜测,你试过
{{@somearray[{{@someotherarray['someotherindex']}}]}}吗? -
是的,先生。浏览器的输出是` ] }}`。
-
另一个猜测:P
{{@index = @someotherarray['someotherindex']}} {{@somearray[@index]}} -
作为 v2 中的一种解决方法,您可以使用
{{F3::set('somevalue',F3::get('someotherarray.someotherindex'))}}在模板中设置新变量 -
投反对票的请解释一下。