| |
I can't access $transaction in there, and I realise that Dwoo handles the assignment of vars different to Smarty (Smarty did it better) but does anyone have this working under Dwoo?
14 Aug 2012
Posts: 16
I did some work with hooks when I was working on a calendar plugin. I hooked into the from process in my calendar class file.
Are you hooking into it in a template? If so it may be a mater of scope as the hook declaration is just like a function declaration. Check what is being passed to the hook.
cheers,
Antony
I'm trying to use a hook (jojo_cart_transaction_report_td) from within a template in jojo_cart_transaction_report.tpl to pull in another template from my theme to show more information.
I've done this successfuly using the new hooks I added to jojo_cart_transaction_list.tpl and it works. I can access the $order variable and display what I need to.
But when I try to do the same with jojo_cart_transaction_report_td I can't get access to the $transaction variable. It is within a loop while the other one isn't, but I'm not sure if that's the difference.
I'll keep testing and see what I come up with.
15 Aug 2012
Posts: 16
Accessing a hook in a template thats awesome!
I would check the scope and confirm that $transation is actually available - you check the declaration of the hook function - you could go print_r($transaction) and wrap it in pre tags that would give you a clear idea of the data structure for it (outside the loop and in a dev environment).
cheers,
Antony
I'm also experimenting with lazyloading after Jai mentioned it at the meetup. Though I started off writing a lazy loader and that progressed into a custom query builder that would automatically lazyload data from dblist and many2many fields only when it was needed. I'd like to scale it back to a simple lazyloader to attach to applicable fields before assigning a dataset to Dwoo.
I'll try the debug dump you mentioned, I hadn't thought that the class function called by the hook would have access to the template vars, so I just never tried it.
I looked into Smarty3 ages ago and it looked very promising (especially being able to assign objects for use in templates) but it still used way more memory than Dwoo.
| Back to Forum Index : Back to Plugin Support |
|
