|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Vicky`s Webgeek Smarty Rookie
Joined: 07 Mar 2007 Posts: 9
|
Posted: Wed Mar 07, 2007 8:08 pm Post subject: |
|
|
damn.
I was sure when I looked at {section} that you needed to pass an array to the loop parameter.
well, I *still* think adding a while loop is a pretty cool hack.
And, if anyone else wants the ability to shoot themselves in the foot with a potentially infinite loop, now they can -- With all the caveats that come along with it. |
|
Back to top |
|
tpr Smarty Rookie
Joined: 27 Mar 2006 Posts: 8
|
Posted: Mon Mar 19, 2007 7:48 pm Post subject: |
|
|
I wouldn't beat yourself up too bad over it as you were not the only one. I came here today looking for the same thing basically.
I have a template that I needed to draw X number of controls on whether there was data passed to it or not. This is a perfect case of some form of loop.
It was not blatantly obvious to me either that you could set loop to a number as opposed to an array to get it to iterate X number of times. |
|
Back to top |
|
emmbec Smarty Rookie
Joined: 01 May 2009 Posts: 10
|
Posted: Thu May 06, 2010 2:15 am Post subject: |
|
|
Well right now I am having a problem where the WHILE loop seems to be my only solution. I am simply writting rows for an HTML table, and I am doing it with a section loop. However inside the loop I need to check some mathematical condition that when TRUE, I need to decrement the current loop index or force the loop to go one more step from the original max value. Unfortunately I have not been able to do so with the current section loop that smarty has, so this WHILE loop is my only solution at this moment, unless someone knows a way to alter a LOOP's index or make it go just an extra round in case some condition happens
Thanks! |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|