Jump to content
  • Advertisement
Sign in to follow this  

[web] horizontal loops w/ smarty

This topic is 4819 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i have some data {0,1,2,3,4,5,6,7,8,9} i would like to arrange it like this using the smarty template engine: 0 1 2 3 4 5 6 7 8 9 unfortunately, i cant get it to do this. i can have a single column, but not two because I cannot increment the loop counter. do any of u know how to get past this?

Share this post


Link to post
Share on other sites
Advertisement
Use the step argument :-)


<table>
{section name=i loop=$data step=2}
<tr><td>$data</td><td>$data[i+1]</td>
{/section}
</table>

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!