How to transfer $data['query'] to Dwoo ? |
[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.
[eluser]Phil Sturgeon[/eluser]
That implementation is being replaced by mine in v1.2 of Dwoo. Get in there early.
[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!
[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.
[eluser]sigork[/eluser]
I took ready examples but sorry, I cannot connect them: Controller from http://ellislab.com/codeigniter/user-gui...arser.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} |
Welcome Guest, Not a member yet? Register Sign In |