<#-- call the macro; the macro variable is already created: -->
<@test2 />
...
<#-- create the macro variable: -->
<#macro test2>
Test text
</#macro>
<#-- call the macro: -->
<@test foo="a" bar="b" baaz=5*8-2 />
<#macro test foo bar baaz>
Test text, and the params: ${foo}, ${bar}, ${baaz}
</#macro>
<#macro img src extra...>
<img src="${src?html}"
<#list extra?keys as attr>
${attr}="${extra[attr]?html}"
</#list>
>
</#macro>
<@img src="http://www.21cp.net/images/logo_nav.gif" width=100 height=50 alt="Test"/>
posted on 2008-10-07 15:35
汪杰 阅读(366)
评论(3) 编辑 收藏 引用 所属分类:
freemarker