Welcome Guest, Not a member yet? Register   Sign In
Dwoo (Phil's edit) - How to use?

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:


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:

// 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

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

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);
        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.

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


Theme © iAndrew 2016 - Forum software by © MyBB