Re: [SMARTY] alphabetically down columns in a table
| From: | Abdul-Wahid Paterson | Date: | Wed, 12 Jan 2005 10:41:31 +0000 |
| Subject: | Re: [SMARTY] alphabetically down columns in a table | ||
| References: | 1 2 3 4 5 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-12149@lists.php.net to get a copy of this message | ||
Hi,
Slight mistake in this code from yesterday. The inner loop {section}
should have
start=$smarty.section.data1.iteration-1
otherwise it misses off the first item from the array.
> Here is my template...cut down a bit to simplifiy the example
>
> <table>
> {math equation="count/$numcols" count=$data|@count assign=length}
> {section name=data1 loop=$data step=$numcols}
> <tr>
> {section name=data2 loop=$data step=$length
> start=$smarty.section.data1.iteration}
> <td><a
> href="sompage.php?data={$data[data2].foo|urlencode}">{$data[data2].bar}</a></td>
> {/section}
> </tr>
> {/section}
> </table>
>
Abdul-Wahid