How to transfer $data['query'] to Dwoo ? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: How to transfer $data['query'] to Dwoo ? (/showthread.php?tid=25071) |
How to transfer $data['query'] to Dwoo ? - El Forum - 11-30-2009 [eluser]sigork[/eluser] This test example works: Controller: Code: $this->db->select('articleid ... '); View: Code: {foreach $articles articleid} 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: ... I get: Quote:Message: Undefined index: articleid Thanks. How to transfer $data['query'] to Dwoo ? - El Forum - 11-30-2009 [eluser]Phil Sturgeon[/eluser] That implementation is being replaced by mine in v1.2 of Dwoo. Get in there early. How to transfer $data['query'] to Dwoo ? - El Forum - 01-10-2010 [eluser]sigork[/eluser] [quote author="Phil Sturgeon" date="1259614714"]That implementation is being replaced by mine in v1.2 of Dwoo. Get in there early.[/quote] I performed the instructions specified here: http://philsturgeon.co.uk/code/codeigniter-dwoo (and I added parser to autoload.php). 'dwoo_test' worked correctly. In a test controller I replaced Code: $this->load->view(THEMEDIR.'site/pages_view', $data); with Code: $this->parser->parse(THEMEDIR.'site/pages_view', $data); If I replace (in View) Code: <?php echo $title; ?> with Code: {$title} it works. But a question: Should I re-write the controller to use arrays in it, not objects? Because as I see the objects work (for example, 'title'). Will Code: $data['query'] = $this->db->get(); work also, or I should re-write it as an array to use it in View with Dwoo? Thanks! How to transfer $data['query'] to Dwoo ? - El Forum - 01-10-2010 [eluser]Phil Sturgeon[/eluser] Arrays and objects are both Fine. personally I hate passing the query object directly to output as it just seems messy but it does work fine. Read the syntax documentation on the Dwoo wiki for more information. How to transfer $data['query'] to Dwoo ? - El Forum - 01-10-2010 [eluser]sigork[/eluser] I took ready examples but sorry, I cannot connect them: Controller from http://ellislab.com/codeigniter/user-guide/libraries/parser.html Code: function index() View from http://wiki.dwoo.org/index.php/Syntax#Blocks Code: <head> Quote:My Blog Heading Smth is wrong, I don't know what EDIT I think I found the solution: Code: {loop $blog_entries title body} |