velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Barbara Baughman <baugh...@utdallas.edu>
Subject Re: set a value in a macro
Date Tue, 23 Aug 2005 17:10:30 GMT
I personally set all of my global variables whenever I touch Velocity,
and I have at least 100 of them, some defined with some pretty
complicated routines.  It doesn't seem to impact response times on the
web application, and it saves a lot of programming and debugging time
to just know they are always there.

I'm very impressed with Velocity's speed.  I'm willing to trade minor
inefficiency for speed in coding.

Barbara Baughman
X2157

On Tue, 23 Aug 2005, Robert Koberg wrote:

> Hi,
>
> Say I have a VM_global_library.vm that has a macro like:
>
> #macro (roleList)
>
>    #set ($roles = ["foo", "bar"])
>
> #end
>
> Should I be able to do the following in a template:
>
> #roleList
> #foreach ($role in $roles)
>    ...
> #end
>
>
> 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?
>
> best,
> -Rob
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message