CodeIgniter Forums
Dwoo (Phil's edit) - How to use? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Dwoo (Phil's edit) - How to use? (/showthread.php?tid=27239)



Dwoo (Phil's edit) - How to use? - El Forum - 02-04-2010

[eluser]gh0st[/eluser]
I'm thinking of using Dwoo because Dwoo supports Template Inheritance, similar to the way Django does it (well sort of) and I am working through the getting started tutorials found at:

http://wiki.dwoo.org/index.php/GettingStarted

However I am stuck at this bit and how to use Dwoo's functionality as I've tried $this->Dwoo->something() but this does not work.

The example says:

Code:
// Retrieve your data using whatever means you use
$articles = getMyArticles();

// Loop over them
foreach($articles as $article) {
    // Output each article using their data (assuming it is an
    // associative array containing "title", "content", "author"
    // and "date" keys)
    $dwoo->output($tpl, $article);
}

// View
    {$content}

But I can't use this->dwoo->output()

Code:
public function dwoo_test()
    {        
        $data['message']     = 'This is dwoo!';
        $data['a']            = 'ABC';
        $data['b']            = 123;
    
        $articles = array("Article 1", "Article 2", "Article 3");
        
        foreach($articles as $article):
            $output = $this->parser->parse('test', $data, TRUE);
        endforeach;
        
        print $output;        
    }

The above either gives me an error message or I just get "Article 3" -- even though it should list them all.

I can't seem to use any of the Dwoo functionality such as $dwoo->get("code_snippet.tpl", $params);

I followed Phil's instructions but can't seem to do very basic Dwoo functionality.


Dwoo (Phil's edit) - How to use? - El Forum - 02-09-2010

[eluser]gh0st[/eluser]
I've decided not to use Dwoo; I'm finding it hard to use/implement and will just use simple PHP like templates.

*Closed*