get parameters from UDT

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
perlman123
New Member
New Member
Posts: 2
Joined: Wed Jul 09, 2008 6:58 am

get parameters from UDT

Post by perlman123 »

Hello,  how can i get parameter from UDT to content page? In page i wrote some JS code which needs some links from php code at user defined tags...
Last edited by perlman123 on Fri Jul 11, 2008 12:02 pm, edited 1 time in total.
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm
Location: Comox Valley, BC

Re: get parameters from UDT

Post by Nullig »

Just assign the value to a variable and use:

return $variable;

in your UDT.

Nullig
User avatar
Augustas
Forum Members
Forum Members
Posts: 241
Joined: Wed Oct 17, 2007 6:09 pm
Location: the world

Re: get parameters from UDT

Post by Augustas »

Here is the full code how to do it.
in UDT:

Code: Select all

$yourvar = 'text';

global $gCms;
$smarty = &$gCms->GetSmarty();
$smarty->assign('mytitle', $yourvar);
Then in your template after UDT is called, you can get your new variable by printing

Code: Select all

{$mytitle}
http://FollowTheRoad.com/ - living on the road...
http://www.kligys.com/ - asmeninis blog'as...
Post Reply

Return to “Developers Discussion”