Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

associative arrays over section arrays

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
arachnius
Smarty n00b


Joined: 09 Jan 2004
Posts: 2

PostPosted: Fri Jan 09, 2004 6:47 pm    Post subject: associative arrays over section arrays Reply with quote

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
View user's profile Send private message
arachnius
Smarty n00b


Joined: 09 Jan 2004
Posts: 2

PostPosted: Fri Jan 09, 2004 7:00 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP