11-30-2009, 08:25 AM
[eluser]sigork[/eluser]
This test example works:
Controller:
View:
I get:
Correct.
But how to get $articles.articleid from $data['query'] ?
I tried this approach (another test), but it doesn't work:
I get:
Thanks.
This test example works:
Controller:
Code:
$this->db->select('articleid ... ');
... ...
$data['query'] = $this->db->get();
$articles = array('articleid' => '123');
$this->dwootemplate->assign('articles', $articles);
View:
Code:
{foreach $articles articleid}
Z{$articles.articleid}
{/foreach}
I get:
Quote:Z123
Correct.
But how to get $articles.articleid from $data['query'] ?
I tried this approach (another test), but it doesn't work:
Code:
...
$data['query'] = $this->db->get();
$i = 0;
foreach ($data['query']->result_array() as $row)
{
$articles[] = array ($i => '123');
$i = $i++;
}
$this->dwootemplate->assign('articles', $articles);
I get:
Quote:Message: Undefined index: articleid
Thanks.