Bugs in associative arrays handling in a section ??
| From: | LIMBOURG Arnaud | Date: | Fri, 12 Oct 2001 10:15:49 +0000 |
| Subject: | Bugs in associative arrays handling in a section ?? | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-1679@lists.php.net to get a copy of this message | ||
Hello,
I've noticed in i build an associative array like
for ($i=0; $i<100;$i++) {
$myarray[$i]= array('data' => $i);
}
and in the template i have
{section name=dummysec loop=$MYARRAY}
{$MYARRAY[dummysec].data}
{/section}
It work well...
BUT (there it comes ;)
if my initial array is build in way i have
$myarray[2] = array('data' => xx);
$myarray[4] = array('data' => xx);
$myarray[5] = array('data' => xx);
The index is random, it seems Smarty wants to have sequential strating from
zero, am i right to assume this ? any workaround ?