Re: [SMARTY] Using a counter
| From: | Monte Ohrt | Date: | Fri, 29 Nov 2002 20:56:43 +0000 |
| Subject: | Re: [SMARTY] Using a counter | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-6601@lists.php.net to get a copy of this message | ||
In a section loop, you could do:
{section name=foo loop=$bar}
{if $smarty.section.foo.iteration is div by 4}
<img src ...>
{/if}
{/section}
On Thu, 2002-11-28 at 04:01, Dorthe Luebbert wrote:
> Hi,
>
> what is the best way to use a counter in Smarty templates?
>
> For example I print out a hash and want to print an image after each 4th
> entry. Right now I work with cycle, but this does not work in cases I
> don't know how many entries are printed out.
>
> Dorthe
--
Monte Ohrt <monte@ispi.net>