velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Koberg <>
Subject set a value in a macro
Date Tue, 23 Aug 2005 17:01:06 GMT

Say I have a VM_global_library.vm that has a macro like:

#macro (roleList)

   #set ($roles = ["foo", "bar"])


Should I be able to do the following in a template:

#foreach ($role in $roles)

OR, how would you globally set a variable that is only needed in a few 
different templates? In other words, I was hoping to instantiate the 
$roles variable only when needed?

Any  ideas?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message