problem with section
| From: | tomas at altern dot org | Date: | Wed, 17 Oct 2001 11:34:24 +0000 |
| Subject: | problem with section | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-1710@lists.php.net to get a copy of this message | ||
Hi!
I have this array '$resultat';
echo "<pre>";print_r($resultat);echo"</pre>";die;
produces:
Array
(
[slut_summa] => 0
[anl] => Array
(
[0] => Array
(
[id] => 2
.
.
.
[namn] => Test3
)
)
)
Then I assign it to smarty: $smarty->assign("rapport", $resultat);
And now I would like to loop through it like this:
{section name=ram loop=$rapport[anl]}
{if %ram.index% is even}
<tr class="udda">
{else}
<tr class="udda">
{/if}
<td class="textA">{$rapport[anl][ram].namn}</td>
</tr>
{/section}
Which I thought would produce the following output:
<tr class="jamn">
<td class="jamn">Test3</td>
</tr>
But instead, surprise, nothing shows. It doesn't even start looping.
Please help, tomas