`
流浪鱼
  • 浏览: 1635593 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

freemarker解析json数组

 
阅读更多

其中imgs数据为[{url:'aaa'},{url:'bbbbb'}]

 

<#assign text>${imgs}</#assign>
	<#assign json=text?eval />
	<#list json as item>
		<img width="30" height="30" src="${item.url}" />
	</#list>

 整体代码为:

<#macro artimgs imgs>
<div class="mt5 pt10 pl10 pr10 bbd pb5 bgwrite mb5" >
	<#assign text>${imgs}</#assign>
	<#assign json=text?eval />
	<#list json as item>
		<img width="30" height="30" src="${item.url}" />
	</#list>
</div>
</#macro>

 

 

分享到:
评论
2 楼 sunteng 2016-04-26  
sunteng 写道
这是json 吗

[{url:'aaa'},{url:'bbbbb'}]
1 楼 sunteng 2016-04-26  
这是json 吗

相关推荐

Global site tag (gtag.js) - Google Analytics