假设我有一个 freemarker 宏:
<#macro helloObject>
World
</#macro>
在某些情况下,我可以很容易地调用它:
Hello, <@helloObject/>!
但是插入它的语法是什么,例如,如果它是字符串的一部分?
<#assign greeting="Hello, <@helloObject>!" /> <#-- doesn't work -->
<#assign greeting="Hello, ${helloObject}!" /> <#-- doesn't work -->
<#assign greeting="Hello, ${@helloObject}!" /> <#-- doesn't work -->
<#assign greeting="Hello, ${<@helloObject/>}!" /> <#-- doesn't work -->
<#assign greeting="Hello, @helloObject!" /> <#-- doesn't work -->
${greeting}