1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'XenForo Development Discussions' started by allewreK, Aug 7, 2013.

  1. allewreK

    allewreK Active Member


    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 ?

  2. Jeremy

    Jeremy XenForo Moderator Staff Member

    Create an array of that size before you call the template to be parsed and you can use xen:foreach.
  3. allewreK

    allewreK Active Member

    Ok thanks you King.

Share This Page