Re: fine examples(I think..)
| From: | Han Byung Jun | Date: | Mon, 28 Apr 2003 18:52:25 +0000 |
| Subject: | Re: fine examples(I think..) | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-9407@lists.php.net to get a copy of this message | ||
I'm Newbie.
I think this is valid...
<!--this is a template file-->
<table 'other attributes'>
<tr 'other attributes'>
{foreach item=item from=$arr}<td>{$item[0]}</td>
<td>{$item[1]}</td>
<td>{$item[2]}</td>
</tr>{/foreach}
</table>
"Dennis Gearon" <gearond@cvc.net> wrote in message
news:3EAD750D.3090207@cvc.net...
> Please CC me (I'm on digest) and also to the list.
>
> QUESTION
> ----------
> If I have:
>
> (in php file)
> $arr= array(
> array( 12345,'george','harrison'),
> array( 23456,'ringo','starry')
> );
>
> and I want a table like so:
>
> <table 'other attributes'>
> <tr 'other attributes'>
> <td>12345</td>
> <td>george</td>
> <td>harrison</td>
> </tr>
> <tr>
> <td>23456</td>
> <td>ringo</td>
> <td>starr</td>
> </tr>
> </table>
>
> and I just want to do:
>
> $smarty->assign( 'arr', $arr );
> $smarty->render ( I forget the syntax);
>
> how would I do it?
>