Page 1 of 1

$smarty->assign v $smarty->assign

Posted: Sun Feb 01, 2009 6:41 pm
by tmk
Both of these seem to work ok in a module....

Code: Select all


$this->smarty->assign('xyz','Something');

$smarty->assign('xyz','Something');

What is the difference, or ramifications of using one or the other?

Re: $smarty->assign v $smarty->assign

Posted: Fri Nov 20, 2009 12:25 am
by suthex
Hey TMK, did you ever get a response or figure out the answer? I have been doing crash course on PHP, Smarty and CMSms over the past month, and this question is top of mind for me too. I couldn't believe 569 times someone read your great question and not once did anyone offer an opinion. So, if I figure it out, I promise to post -- and if you did, let me know.

Doug

Re: $smarty->assign v $smarty->assign

Posted: Fri Nov 20, 2009 1:58 am
by Peciura

Code: Select all

$this->smarty->assign('xyz','Something');
It is valid in modules.

Code: Select all

$smarty->assign('xyz','Something');
works because in index.php there is an assignment

Code: Select all

$smarty = &$gCms->smarty;
In general  you will be OK if you put in your php files

Code: Select all

if (!isset($gCms)) exit;
...$gCms->smarty...
and in UDTs :

Code: Select all

global $gCms;
...$gCms->smarty...