如何在freemarker中使用另一个.ftl的变量
我正在尝试在第二个模板中使用定义的变量,以在当前输出中具有相同的输出。
模板1:
[#if definition.name=="configMINIMAL_STACK_SIZE"]
[#assign valueMinimalStackSize = definition.value]
[/#if]
第二模板:
#define configMINIMAL_STACK_SIZE ((uint16_t)${valueMinimalStackSize})
请在第二个模板中获得与“ valueminimalstacksize”相同的输出?
感谢您的帮助
I'm trying to use a defined variable in a second template to have the same output in the current one.
template 1:
[#if definition.name=="configMINIMAL_STACK_SIZE"]
[#assign valueMinimalStackSize = definition.value]
[/#if]
Second template:
#define configMINIMAL_STACK_SIZE ((uint16_t)${valueMinimalStackSize})
how could I have the same output of "valueMinimalStackSize " in the second template please ?
Thanks for the help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以拥有一个设置这些变量的模板,我们将其称为
“ Commons.ftl”
,然后在开始时使用< #include“ commons.ftl”>
其他模板。You could have a template that sets these variables, let's call it
"commons.ftl"
, and then use<#include "commons.ftl">
at the beginning of other templates.