Page 1 of 1
UDT programming
Posted: Fri Mar 09, 2007 4:15 am
by mahjong
mahjong wrote:
I need to use $this->ProcessTemplateFromData() from inside a UDT.
How?
Any idea?
Re: UDT programming
Posted: Fri Mar 09, 2007 10:27 pm
by Dee
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.
Code: Select all
$gCms->smarty->display('your_template.tpl');
Regards,
D
Re: UDT programming
Posted: Fri Mar 09, 2007 10:33 pm
by Dee
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
Re: UDT programming
Posted: Sat Mar 10, 2007 2:52 am
by mahjong
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.
Re: UDT programming
Posted: Sat Mar 10, 2007 3:57 am
by calguy1000
The best way to use processtemplatefromdata in a udt would be to copy and paste and modify the function source forom modulesuuport