Re: Comparing section index to last
| From: | Jens Lehmann | Date: | Mon, 29 Apr 2002 16:16:06 +0000 |
| Subject: | Re: Comparing section index to last | ||
| References: | 1 2 3 4 5 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-3927@lists.php.net to get a copy of this message | ||
> I seem to get wrong results when attempting the following:
>
> {if $smarty.section.catid.index == $smarty.section.catid.last}
>
> "do this"
>
> {/if}
>
> "do this" will show up on the first and last time through the loop.
>
> ron
>
$smarty.section.catid.index is a number whereas $smarty.section.catid.last
is a boolean value.
This is what you want:
{if $smarty.section.catid.last}
...
{/if}
Have a look at
http://www.phpinsider.com/php/code/Smarty/docs/language.function.section.htm
l#AEN986.
Jens