$tpl->draw('template') in a loop

60 views
Skip to first unread message

nessuno nobody

unread,
Dec 7, 2011, 4:16:42 PM12/7/11
to raintpl
Hello,
I've got a draw call in a simple loop.
I collect the variables into an array ($arr) and i do:
for(bla; bla; bla) {
$message_from_db = $query;
$vals['bli'] = $message_from_db;
...
$tpl->assing($vals);
$tpl->draw('template');
}
So, i collect all the messages ( that are different) with queries, but
when I call $tpl->draw('template');
I have n times the first message. But, if i edit the code in this way:
for(bla; bla; bla) {
$message_from_db = $query;
$vals['bli'] = $message_from_db;
...
print_r($vals); //HERE
$tpl->assing($vals);
$tpl->draw('template');
}
I can see that all the data in the array are different. So everything
work except the draw call.
How can i solve?

Rain

unread,
Dec 7, 2011, 4:19:02 PM12/7/11
to raintpl
Easy:

$tpl = new Raintpl;

for(bla; bla; bla) {
$message_from_db = $query;
$vals['bli'] = $message_from_db;
...
}

$tpl->assing($vals);
$tpl->draw('template');

Reply all
Reply to author
Forward
0 new messages