Jump to content
  • Advertisement
Sign in to follow this  
Uthman

[web] horizontal loops w/ smarty

This topic is 4907 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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!