$smarty->assign v $smarty->assign

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
tmk
Forum Members
Forum Members
Posts: 25
Joined: Sun Sep 23, 2007 4:07 am

$smarty->assign v $smarty->assign

Post 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?
User avatar
suthex
New Member
New Member
Posts: 8
Joined: Mon Jul 20, 2009 11:00 pm
Location: Proudly Sitting in a Chair somewhere in Canada

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

Post 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
We've been building kick-ass online sites using CMS Made Simple since 2008.
Peciura

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

Post 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...
Last edited by Peciura on Fri Nov 20, 2009 8:43 am, edited 1 time in total.
Post Reply

Return to “Developers Discussion”