Re: [SMARTY] For
| From: | messju mohr | Date: | Fri, 21 Feb 2003 12:31:44 +0000 |
| Subject: | Re: [SMARTY] For | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-8075@lists.php.net to get a copy of this message | ||
On Fri, Feb 21, 2003 at 01:16:31PM +0100, Mattias Hallström wrote:
> Hi,
>
> Probably a pretty simple question.
> Smarty has got foreach and sections, but how do I "for($i=0; $i<6;
> $i++)" ?
>
> The number 6 is assigned to a simple variable.
{section name=i loop=$max}
...
{/section}
with $max being an integer. you do not have to have an
an array of values to use {section}
you can also supply start max and step. see:
http://smarty.php.net/manual/en/language.function.section.php
have fun
messju
> //Mattias