You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Lev Epshteyn <le...@corsis.com> on 2001/12/17 17:39:44 UTC

loops

Is there any way to make a loop that runs for some number of iterations?
I need to make a date selection box, so obviously if I could make one using:

<select name="date">
#foreach ($day in [1 .. 31])
<option value="$!day">$!day</option>
#end
</select>

is there anything that would let me do this?

(I know I could just create a utility method that wold create arrays for me,
but I'm wondering if one already exists)

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: loops

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On 12/17/01 11:39 AM, "Lev Epshteyn" <le...@corsis.com> wrote:

> Is there any way to make a loop that runs for some number of iterations?
> I need to make a date selection box, so obviously if I could make one using:
> 
> <select name="date">
> #foreach ($day in [1 .. 31])
> <option value="$!day">$!day</option>
> #end
> </select>
> 
> is there anything that would let me do this?

Well, the syntax you just suggested is valid :)

Go for it!

> 
> (I know I could just create a utility method that wold create arrays for me,
> but I'm wondering if one already exists)
> 
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 

-- 
Geir Magnusson Jr.                                     geirm@optonline.net
System and Software Consulting
"He who throws mud only loses ground." - Fat Albert


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>