PHP / SMARTY question
| From: | Sheldon Jones - Admin | Date: | Fri, 12 Jul 2002 00:51:51 +0000 |
| Subject: | PHP / SMARTY question | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-5256@lists.php.net to get a copy of this message | ||
Can someone tell me which method is better?
Method A, pass by referance:
$smarty = new Smarty;
function x(&$smarty) {
$smarty->assign("x", "some value");
}
print x($smarty);
Method B, use globals:
$smarty = new Smarty;
function x() {
global $smarty;
$smarty->assign("x", "some value");
}
print x();
Thanks for your time,
--
--Sheldon
------------------------------------------------------
Sheldon Jones
Systems Administrator
Lobo Internet Services, Ltd.
mailto:sheldon@hobbydump.com
Does Microsoft mean "small and limp"?
What's with the 'Intel Inside' warning label anyway?
------------------------------------------------------