Re: displaying a MATRIX?
| From: | Andrei Zmievski | Date: | Fri, 07 Sep 2001 19:55:20 +0000 |
| Subject: | Re: displaying a MATRIX? | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-1448@lists.php.net to get a copy of this message | ||
I added direct indexing by numbers only in the latest unreleased
version.
On Fri, 07 Sep 2001, Pablo Veliz wrote:
> 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
>
>
> ---
> You are currently subscribed to smarty as: andrei@ispi.net
> To unsubscribe send a blank email to $subst('Email.Unsub')
> Visit Smarty's homepage at
> http://www.phpinsider.com/php/code/Smarty/
-Andrei
* Anything will fit if you push hard enough *