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

nested loop problem

 
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 -> General
View previous topic :: View next topic  
Author Message
teddy
Smarty n00b


Joined: 22 Jul 2003
Posts: 1

PostPosted: Tue Jul 22, 2003 9:34 am    Post subject: nested loop problem Reply with quote

I wanna to count the looping number in a nested loop. for example in PHP we can:
$count=1;
(for $i=0;$i<3;$i++)
(for $j=0;$j<4;$j++)
{echo "number is:".$count;$count++;}

//result is showing "number is: 1,2,.........12"

but how i can get the looping number in smarty?
like following code:
{section name=key loop=$a}
{$a[key]}
{section name=key1 loop=$b[key]}
{* some methods to get the cycling number here??*}
{/section}
{/section}
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Tue Jul 22, 2003 10:42 am    Post subject: Reply with quote

see http://smarty.php.net/manual/en/language.function.counter.php
or maybe http://smarty.php.net/manual/en/language.function.cycle.php
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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 -> General 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