section step

From: Date: Tue, 27 Nov 2001 16:19:58 +0000
Subject: section step
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-2052@lists.php.net to get a copy of this message
<prologue> Since this is my first post to the list, I'd like to thank Monte and Andrei for saving me a lot of work. I was just about to give up on the available template systems and write my own when I discovered Smarty. I can't believe I hadn't been exposed to it before. </prologue> On to my problem. Maybe I'm missing something in the manual, but I have the following problem. I want to step thru an array by 4 so I end up with four columns in the table. My question is, how do I accomplish the modification of the index to reference the 2nd, 3rd and 4th indices? <code> {section name=sec1 loop=$links step=4} <tr height=35 bgcolor="{if %sec1.iteration% is even}#cccccc{else}#ffffff{/if}"> <td align=center width=25%><a href="{$links[sec1]}">{$makes[sec1]}</a></td> <td align=center width=25%><a href="{$links[???]}">{$makes[???]}</a></td> <td align=center width=25%><a href="{$links[???]}">{$makes[???]}</a></td> <td align=center width=25%><a href="{$links[???]}">{$makes[???]}</a></td> </tr> {/section} </code>

« previous php.smarty.general (#2052) next »