我的模板文件中有以下代码:
{foreach from=$items item=entry}
<pre>
{$entry->nb_persons|@print_r}
</pre>
{/foreach}
输出是(json字符串):
{"ip":"12.12.12.12","date":1375616434,"cartitems":["foo:1"],"company":"dsad","FirstName":"sad","LastName":"asdsad","street":"","postcode":"","city":"","country":"Andorra","phone":"456456","fax":"","email":"sad@sad.com","comefrom":"google","request":"","message":"sadads"}
我想单独打印每个元素,例如:
{$entry->nb_persons.company}
应该给我->“dsad”
但这不起作用,我不知道为什么。