Re: [SMARTY] Help in <can't describe it> appreciated
| From: | Jason Sweat | Date: | Sun, 23 Feb 2003 03:53:16 +0000 |
| Subject: | Re: [SMARTY] Help in <can't describe it> appreciated | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-8131@lists.php.net to get a copy of this message | ||
php:
$t = new Smarty;
$d = array(
2 => array(
'enums' => array(6 => 'blue',5 => 'yellow',7
=>'red')
,'name' => 'color'
)
,11 => array(
'enums' => array(15 => 'polyester',13 => 'cotton')
,'name' => 'material'
)
,1 => array(
'enums' => array(9 => 'S',8=>'M',11=>'L',
10=>'XL')
,'name' => 'size'
)
);
$t->assign(array(
'mat' => $d[11]
,'col' => $d[2]
,'siz' => $d[1]
));
$t->display('test.tpl');
template:
<table border="1">
{foreach from=$mat.enums item=cur_mat key=key_mat name=mat}
{if $smarty.foreach.mat.first}
<tr><th colspan="2">{$mat.name}</th></tr>
{/if}
<tr valign="top"><td>{$key_mat} => {$cur_mat}</td>
<td><table border="1">
{foreach from=$siz.enums item=cur_siz key=key_siz name=siz}
{if $smarty.foreach.siz.first}
<tr><th colspan="2">{$siz.name}</th></tr>
{/if}
<tr valign="top"><td>{$key_siz} => {$cur_siz}</td>
<td><table border="1">
{foreach from=$col.enums item=cur_col key=key_col name=col}
{if $smarty.foreach.col.first}
<tr><th colspan="2">{$col.name}</th></tr>
{/if}
<tr valign="top"><td>{$key_col} => {$cur_col}
{/foreach}
</table>
</td></tr>
{/foreach}
</table>
</td></tr>
{/foreach}
</table>
----- Original Message -----
From: "Joscha Feth" <joscha@feth.com>
To: <smarty-general@lists.php.net>
Sent: Saturday, February 22, 2003 12:05 PM
Subject: [SMARTY] Help in <can't describe it> appreciated
> Please read here, I put together a small description of my problem - all
> thoughts, ideas, advises, better methods, etc. appreciated (I am nearly
> getting crazy with this thing)
>
> http://www.feth.com/uploads/case_study1.html
>
> Greets,
> Joscha
>
>
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>