Troubles with Loops in Dwoo Parser |
[eluser]Clooner[/eluser]
I'm using phil's dwoo library and initial testing seems to be working fine. However I run intro trouble when I start using the loop function. Here is my code Code: {$myurl}
[eluser]Mareshal[/eluser]
Code: {$myurl} read this: http://wiki.dwoo.org/index.php/Loop
[eluser]Clooner[/eluser]
[quote author="Mareshal" date="1288744192"] Code: {$myurl} read this: http://wiki.dwoo.org/index.php/Loop[/quote] Thanks for the reply however I fail to see how this is different from my code since it outputs the same error! The problem is $myurl is not found inside the loop. The link you described also gives no hint about my problem which I also stated in my initial post. I believe I need to call $myurl inside the loop using some modification but I don't know how.
[eluser]Mareshal[/eluser]
Paste the code from your controller, before calling parse()
[eluser]Clooner[/eluser]
[quote author="Mareshal" date="1288747700"]Paste the code from your controller, before calling parse()[/quote] That's simply Code: $data = array(
[eluser]cahva[/eluser]
Theres atleast 2 options. Either use {foreach} instead of {loop}: Code: {foreach $products product} Or when using loop, use {$_.myurl} to get to parent scope Code: {loop $products} Check out the Shortcuts page.
[eluser]Clooner[/eluser]
[quote author="cahva" date="1288753207"]Theres atleast 2 options. Either use {foreach} instead of {loop}: Code: {foreach $products product} Or when using loop, use {$_.myurl} to get to parent scope Code: {loop $products} Check out the Shortcuts page.[/quote] Thanks, that is what I needed to know... it's my first time using a template engine! |
Welcome Guest, Not a member yet? Register Sign In |