Template : for loop alternative ? Eg : Generate html code for 5 times.

Jean-Baptiste

Well-known member
Hello,

I made a form, where a user choose a number (let's say 5 as en example).

When he POST the request, I am sending to my template this number. I would like that, in the template, a code is generated XX times (5 times here).

Since it's a simple number, I don't get a way to parse it into my foreach loop (since foreach needs an array).

Any ideas ?

Regards.
 
Create an array of that size before you call the template to be parsed and you can use xen:foreach.
 
Back
Top Bottom