UDT programming

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
mahjong

UDT programming

Post by mahjong »

mahjong wrote: I need to use $this->ProcessTemplateFromData() from inside a UDT.

How?
Any idea?
Dee
Power Poster
Power Poster
Posts: 1197
Joined: Sun Mar 19, 2006 8:46 pm

Re: UDT programming

Post 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
Dee
Power Poster
Power Poster
Posts: 1197
Joined: Sun Mar 19, 2006 8:46 pm

Re: UDT programming

Post 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
mahjong

Re: UDT programming

Post 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.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: UDT programming

Post by calguy1000 »

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.
Locked

Return to “CMSMS Core”