|
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 |
jyurkiw Smarty Rookie
Joined: 03 Dec 2004 Posts: 5
|
Posted: Fri Dec 31, 2004 7:56 pm Post subject: manipluating a section index |
|
|
Is there an easy way to directly manipulate the $smarty.section.sectionName.index variable in a {section} tag?
Here's my problem...I have an array of objects. Each object has a variable X in it that defaults to zero, but in some instances can be set to a value greater than zero. In the template, if X is NOT zero, I want to then skip the next Y objects in the array, where Y is the value contained in X. (make sense?)
If it were raw PHP code I was working with, instead of using a {section} i would have this in a for loop like so
Code: |
$array = array of objects.
for ($x=0; $x<whatever; $x++) {
echo "this is some information based on $array[$x]";
if ($array[$x]->skipNumber > 0) {
$x += $array[$x]->skipNumber;
}
}
|
Is there any way to do this in smarty???
jeff[/code] |
|
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
|