velocity 判断true有没有坑
答案:2 悬赏:20
解决时间 2021-02-03 10:49
- 提问者网友:斯文败类
- 2021-02-02 21:40
velocity 判断true有没有坑
最佳答案
- 二级知识专家网友:统治我的世界
- 2021-02-02 23:08
使用Velocity,当然就免不了要使用宏,或者说使用Velocity而不使用其宏,就相当于废了Velocity一半以上的武功,非常可惜的。
怎么使用Velocity的宏呢,才最大程度的发挥其作用但是又避免掉入其中的坑呢?且听悠然乱弹乱弹:
官方文档中,关于Macro是这么说的:
#macro - Allows users to define a Velocimacro (VM), a repeated segment of a VTL template, as required
Format:
# [ { ] macro [ } ] ( vmname $arg1 [ $arg2 $arg3 ... $argn ] ) [ VM VTL code... ] # [ { ] #end [ } ]
•vmname - Name used to call the VM (#vmname)
•$arg1 $arg2 [ ... ] - Arguments to the VM. There can be any number of arguments, but the number used at invocation must match the number specified in the definition.
•[ VM VTL code... ] - Any valid VTL code, anything you can put into a template, can be put into a VM.
Once defined, the VM is used like any other VTL directive in a template.
怎么使用Velocity的宏呢,才最大程度的发挥其作用但是又避免掉入其中的坑呢?且听悠然乱弹乱弹:
官方文档中,关于Macro是这么说的:
#macro - Allows users to define a Velocimacro (VM), a repeated segment of a VTL template, as required
Format:
# [ { ] macro [ } ] ( vmname $arg1 [ $arg2 $arg3 ... $argn ] ) [ VM VTL code... ] # [ { ] #end [ } ]
•vmname - Name used to call the VM (#vmname)
•$arg1 $arg2 [ ... ] - Arguments to the VM. There can be any number of arguments, but the number used at invocation must match the number specified in the definition.
•[ VM VTL code... ] - Any valid VTL code, anything you can put into a template, can be put into a VM.
Once defined, the VM is used like any other VTL directive in a template.
全部回答
- 1楼网友:陪我到地狱流浪
- 2021-02-03 00:33
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯
• 手机登qq时,显示手机磁盘不足,清理后重新登 |
• 刺客的套装怎么选啊? |