Rag*_*ghu 2 freemarker map literals built-in built-in-types
我找不到有关如何合并两个哈希映射的任何文档。这就是我想要实现的
<select <@render_attrs commonattrs. 合并({"class":"select"}) /> > ....
<#macro render_attrs attrs>
<#list attrs?keys as key>
<#if attrs[key]!="">
${key}="${attrs[key]}"
</#if>
</#list >
commonattrs + {"class": "select"}
Run Code Online (Sandbox Code Playgroud)
它记录在这里:http : //freemarker.org/docs/dgui_template_exp.html#dgui_template_exp_hashop
| 归档时间: |
|
| 查看次数: |
1984 次 |
| 最近记录: |