Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

manipluating a section index

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty Development
View previous topic :: View next topic  
Author Message
jyurkiw
Smarty Rookie


Joined: 03 Dec 2004
Posts: 5

PostPosted: Fri Dec 31, 2004 7:56 pm    Post subject: manipluating a section index Reply with quote

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty Development All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP