Passing parameters between Velocity templates

I am trying to find out how to pass parameter while calling a velocity template from another.

it looks like this

File: _reading_tracker.vm

#parse("student/shared/_bio_data.vm")

I need to pass some arguments to the _bio_data.vm. Not sure how to do this


Instead of parsing _bio_data.vm , try creating a macro, and then calling that macro from _reading_tracker.vm .

Or, if you don't want to use a macro, then you should be able to #set($var="value") any number of variables in the outer template, and refer to those variables in the inner (parsed) template.

链接地址: http://www.djcxy.com/p/8302.html

上一篇: NSMutableDictionary添加和删除KVO

下一篇: 在Velocity模板之间传递参数