displaying a MATRIX?
| From: | Pablo Veliz | Date: | Fri, 07 Sep 2001 16:26:52 +0000 |
| Subject: | displaying a MATRIX? | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-1446@lists.php.net to get a copy of this message | ||
I have the followin template:
<table width="700">
<tr bgcolor="red">
<td>{$items}</td>
</tr>
{section name=j loop=$items}
<tr>
<td>-{$items[j][0]}-</td>
<td>+{$items[j][1]}+</td>
<td>={$items[j][2]}=</td>
<td>/{$items[j][3]}/</td>
<td>:{$items[j][4]}:</td>
<td>;{$items[j][5]};</td>
</tr>
{/section}
</table>
and the followin php code:
<?
require("Smarty.class.php");
$smarty = new Smarty;
for($i=0;$i<10;$i++) {
$q[$i]=array("como","que","no","me","la","se");
}
$smarty->assign("items",$q);
$smarty->display("matre.tpl");
?>
Why I don't get the expected matrix displayed correctly? is there a way to display a matriz
using something like {$var[loopindex][something]} in the template?
TIA
--
Pablo Veliz