RE: [SMARTY] trouble with arrays in template
| From: | Florian Winkler | Date: | Thu, 24 Jul 2003 01:57:56 +0000 |
| Subject: | RE: [SMARTY] trouble with arrays in template | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-9954@lists.php.net to get a copy of this message | ||
Hi ,
You should solve this task in another way :
$your_array = array(
'links' =>
array($gallery_dir.'photos/gallery/yellow/Bikes0.jpg',
$gallery_dir.'photos/gallery/yellow/Bikes1.jpg',
$gallery_dir.'photos/gallery/yellow/Bikes1.jpg',
$gallery_dir.'photos/gallery/yellow/Bikes2.jpg',
$gallery_dir.'photos/gallery/yellow/Bikes3.jpg',
$gallery_dir.'photos/gallery/yellow/Bikes4.jpg',
$gallery_dir.'photos/gallery/yellow/Bikes5.jpg'),
'alt' =>
array('1','2','3','4','5'),
$tpl->assign("your_array",$your_array);
########################
<table>
<tr>
{section name=p loop=$your_array.links}
{if $smarty.section.p.index is div by 2 && $smarty.section.p.index != 0}
</tr>
<tr>
{/if}
<td>{$your_array.links[p]}</td>
{/section}
</tr>
</table>
greetz fLo
_________________________________________________________________
Fotos - MSN Fotos das virtuelle Fotoalbum. Allen Freunden zeigen oder einfach online entwickeln lassen: http://photos.msn.de/support/worldwide.aspx