我将一个数组传递给smarty,它看起来像这样:
array(2) {
[0]=>
array(1) {
["name"]=>
string(6) "Test 1"
}
[1]=>
array(1) {
["name"]=>
string(6) "Test 2"
}
}
当我尝试使用:
来迭代它时{foreach $arrTest as $tmp}
Test
{/foreach}
我得到错误:无效的属性名称:'$arrTest'
Smarty version 3.1.4
我看到有人说我需要关闭magic_quotes_runtime,但它已经关闭了。magic_quotes_gpc也是如此。
任何想法?
{foreach from=$arrTest item=arr}
{$arr.name}
{/foreach}