get value of the string stored in a variable, whose name stored as string in another variable

别说谁变了你拦得住时间么 提交于 2019-12-02 00:37:40

问题


<#assign blah = "foo">
<#assign foo = "awesome">

Can we render "awesome" without referencing foo ?

I tried something like ${${blah}}

But it isn't working, any ideas ?


回答1:


There is an eval built-in which evaluates a string as an FTL expression.

In your case use it like this:

${blah?eval}


来源:https://stackoverflow.com/questions/21276930/get-value-of-the-string-stored-in-a-variable-whose-name-stored-as-string-in-ano

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!