Any idea?mahjong wrote: I need to use $this->ProcessTemplateFromData() from inside a UDT.
How?
UDT programming
-
mahjong
UDT programming
Re: UDT programming
You cannot use ProcessTemplateFromData from a UDT (because it's a module method). 
I think you need to use the global $gCms->smarty object (and it's display method) directly.
Regards,
D
I think you need to use the global $gCms->smarty object (and it's display method) directly.
Code: Select all
$gCms->smarty->display('your_template.tpl');D
Re: UDT programming
I'm no Smarty expert by far, but I think to use data instead of a file as template, you'd need to define your own resource plugin functions and register them with Smarty.
Regards,
D
Regards,
D
-
mahjong
Re: UDT programming
Thank you for answering.
For now, I'll been accessing ProcessTemplateFromData() indirectly, by using a module declaration. I was hoping something more efficient. Seems to me, I'm the first or pushing the envelop of CMSMS can do. Anyway, I've re-written my UDT with another logic, starting over with the basics taken from other tags (plugins).
Thank you again.
For now, I'll been accessing ProcessTemplateFromData() indirectly, by using a module declaration. I was hoping something more efficient. Seems to me, I'm the first or pushing the envelop of CMSMS can do. Anyway, I've re-written my UDT with another logic, starting over with the basics taken from other tags (plugins).
Thank you again.
-
calguy1000
- Support Guru

- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: UDT programming
The best way to use processtemplatefromdata in a udt would be to copy and paste and modify the function source forom modulesuuport
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.

