比如:有一个数组array("aa","bb","cc") 另一数组array("www.aa.com","www.bb.com","www.cc.com") 现在要实现的功能是通过smarty中的section循环,$smarty->assign("test",array(name=>array("aa","bb","cc") ,url=>array("www.aa.com","www.bb.com","www.cc.com"))); {section name=test loop=$test}
<a href={$test[test].url}>{$test[test].name}</a>
{/section}但这样写显然是错的,那们高手帮一下。可能表达很乱,不知道能不能看懂。
<a href={$test[test].url}>{$test[test].name}</a>
{/section}但这样写显然是错的,那们高手帮一下。可能表达很乱,不知道能不能看懂。
<a href={$test.url[id].url}>{$test.name[id].name}</a>
{/section}