[PHPTAL] unknown keys in an array

Federico frugnale at gmail.com
Tue Jun 20 19:28:48 CEST 2006


> and i need a table to looks like
>
> <table>
> <tr><? foreach($months as $tMont) echo "<td>$tMonth</td>"; ?></tr>
> <?
> foreach($codes as $kCode => $code){
> echo "<tr><td>$code</td>";
> foreach($months as $nMonth => $tMont){
> echo "<td>".$cotent[$kCode][$nMonth]."</td>";
> }
> echo "</tr>";
> }
> echo "</table>";
>
> sugestions please.
>
You can nest tal:repeat block:

<table>
<tr>
    <td tal:repeat="tMont months" tal:content="tMonth"></td>
</tr>
<tr tal:repeat="code codes">
    <td tal:content="code"></td>
    <td tal:repeat="tMont months" 
tal:content="cotent/${repeat/code/key}/${repeat/tMont/key}"></td>
</tr>
</table>




More information about the PHPTAL mailing list