|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
arachnius Smarty n00b
Joined: 09 Jan 2004 Posts: 2
|
Posted: Fri Jan 09, 2004 6:47 pm Post subject: associative arrays over section arrays |
|
|
Hello Smarty people!
I try do that:
{section name=logs loop=$colunas.cadsu_nome}
<tr valign="top" class="{cycle values="linha2,linha1"}">
{section name=coln loop=$colnames}
<td align="center"><font size="1">{$colunas.$colnames[coln][logs]}</td>
{/section}
</tr>
{/section}
Where
$colnames = Array
(
[0] => cadsu_nome
[1] => count
[2] => categ_nome
)
And
$colunas = Array
(
[cadsu_nome] => Array
(
[0] => Compra
[1] => Venda
[2] => Compra
)
[count] => Array
(
[0] => 6
[1] => 5
[2] => 2
)
[categ_nome] => Array
(
[0] => Informática
[1] => Eletrodomésticos
[2] => Livros
)
)
But I have this syntax error:
Warning: Illegal offset type in templates_c/%%124/%%1247940846/logs.htm.php on line 112
how can I resolv this stuff?
Thanks |
|
Back to top |
|
arachnius Smarty n00b
Joined: 09 Jan 2004 Posts: 2
|
Posted: Fri Jan 09, 2004 7:00 pm Post subject: |
|
|
I did this form:
{section name=logs loop=$colunas.cadsu_nome}
<tr valign="top" class="{cycle values="linha2,linha1"}">
{section name=coln loop=$colnames}
{assign var="temp_index" value=$colnames[coln]}
<td><font size="1">{$colunas.$temp_index[logs]}</td>
{/section}
</tr>
{/section}
And Works! |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|