Re: [SMARTY] Block Functions
| From: | makler+smarty-general at man dot torun dot pl | Date: | Fri, 15 Nov 2002 07:54:50 +0000 |
| Subject: | Re: [SMARTY] Block Functions | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-6438@lists.php.net to get a copy of this message | ||
On Thu, Nov 14, 2002 at 12:17:43PM -0500, Jeremy Sisson wrote:
> that can count from x to y, etc. Foreach doesn't seem to be able to do
> it, and section can't seem to do it without a 'loop' variable to look at.
"loop" variable could be just a number. Try this:
{section start="0" name="test" loop="5"}
Test index={$smarty.section.test.index}<br>
{/section}
that outputs:
Test index=0
Test index=1
Test index=2
Test index=3
Test index=4
or this:
{section start="0" name="test" loop="5" step="2"}
Test index={$smarty.section.test.index}<br>
{/section}
output:
Test index=0
Test index=2
Test index=4
Regards,
Piotr Klaban