NYCPHP Meetup

NYPHP.org

[nycphp-talk] Smarty syntax: for(...)

jon baer jonbaer at jonbaer.net
Wed Oct 22 17:43:43 EDT 2003


learn something new everyday :-)

thank you, just confirmed it ...

{section name=test loop=30}
 # {counter}<br/>
{/section}

- jon

----- Original Message -----
From: "Birgit Wolter" <bw at megabit.net>
To: "NYPHP Talk" <talk at lists.nyphp.org>
Sent: Wednesday, October 22, 2003 5:44 PM
Subject: Re: [nycphp-talk] Smarty syntax: for(...)


> Hello Scott,
> try this:
>
>   <select name="number">
>     {section name=i loop=50}
>        <option value="{$smarty.section.i.index}">{$smarty.section.i.index}
>     {/section}
>   </select>
>
> It will loops from 0 - 49.
> It's not in the documentation. I found it in a forum, but can't
> remember where. But it works just fine with me.
> Birgit
>
> > Hello,
>
> > I am working with Smarty templates but I am having trouble trying to do
> > what I want with them.  I want to print a block of code a specific
> > number of times sort of like I would do with a for() loop in PHP. I am
> > not using values from an array so I can't use section or foreach loops.
> >   I can't find in the documentation how to turn something like this into
> > Smarty code:
>
> > for($i = 0; $i < max_iters; ++$i) {
> >   echo $i . "<br />";
> > }
>
> > Does anyone have any suggestions?
>
> > Thanks
> > Scott Mattocks
>
> > _______________________________________________
> > talk mailing list
> > talk at lists.nyphp.org
> > http://lists.nyphp.org/mailman/listinfo/talk
>
>
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk
>




More information about the talk mailing list