For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > March 2004 > Re: [SMARTY] FAQ: simple loop









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [SMARTY] FAQ: simple loop
Messju Mohr

2004-03-19, 1:28 pm

On Mon, Mar 01, 2004 at 12:56:17PM +0200, David Förster wrote:
> Hello,
>
> this is what the faq says about doing a simpe for-loop:
>
> ===
> {section name="myLoop" start=0 loop=5}
> index={$smarty.section.myLoop.index}
> {/section}
>
> This will output:
>
> index=0
> index=1
> index=2
> index=3
> index=4
> index=5
> ===
>
> When I try it, the latest element that is printed is index=4.
>
> Is this an error in the faq or in smarty?


this error is in the faq then.

> - david

Randum Ian

2004-03-19, 1:28 pm

It should be loop=6 because 5 repetitions starting from 0 is index=4 which
is right.

> On Mon, Mar 01, 2004 at 12:56:17PM +0200, David Förster wrote:
>
> this error is in the faq then.
>
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



Randum Ian
ian@randumian.co.uk
CBDagency Web Consultant
http://www.cbdagency.com
DancePortalGlobal Webmaster
http://www.danceportalglobal.com
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com