Welcome Guest, Not a member yet? Register   Sign In
How to transfer $data['query'] to Dwoo ?
#1

[eluser]sigork[/eluser]
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.


Messages In This Thread
How to transfer $data['query'] to Dwoo ? - by El Forum - 11-30-2009, 08:25 AM
How to transfer $data['query'] to Dwoo ? - by El Forum - 11-30-2009, 08:58 AM
How to transfer $data['query'] to Dwoo ? - by El Forum - 01-10-2010, 08:42 AM
How to transfer $data['query'] to Dwoo ? - by El Forum - 01-10-2010, 08:47 AM
How to transfer $data['query'] to Dwoo ? - by El Forum - 01-10-2010, 10:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB