Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macors支持 #69

Closed
xingzhewj opened this issue Jun 28, 2016 · 9 comments
Closed

macors支持 #69

xingzhewj opened this issue Jun 28, 2016 · 9 comments

Comments

@xingzhewj
Copy link

对于#macro (test) 这种的在vm中调用的时候,现在貌似只能采用#test()这种调用方式。
可否也支持#test这种方式的调用呢?

@shepherdwind
Copy link
Owner

不是很明白什么意思?可以解释更清楚一些吗?

@xingzhewj
Copy link
Author

是这样子的。例如a.vm中有#macro (test)一行,在b.vm中#test调用的时候没有调用成功而是原样输出了#test, 如果我在b.vm中#test()这样去调用就没有问题了,就是想可以也支持#test这种的调用吗?

@shepherdwind
Copy link
Owner

http://velocity.apache.org/engine/devel/user-guide.html#velocimacros velocity 没有你说的这种 #test 直接执行的吧。

@xingzhewj
Copy link
Author

是这样的。tomcat中的velocity配置确实也识别那样的写法,但由于vm不好轻易改动,所以看是否也能支持这样的写法!

@shepherdwind
Copy link
Owner

我看下怎么处理下

@xingzhewj
Copy link
Author

ERROR Parse error on line 67: #foreach(${itemData} in ${defaultData}) Expecting 'ID', got 'MAP_BEGIN'
查到正常写法是#foreach($itemData in $defaultData);但是可否支持上面的写法呢?

@shepherdwind
Copy link
Owner

0.8.4 修复了 #foreach 的问题

@shepherdwind
Copy link
Owner

那种没有括号的,估计比较难实现了,而且容易和 css 选择器冲突啥的。

@xingzhewj
Copy link
Author

恩恩!我修改下vm,按照标准得来!非常给力!!点赞!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants