Re: [SMARTY-DEV] mixing of asign() and assign_by_ref() overwrites external vars
| From: | Sebastian Mendel | Date: | Mon, 07 Jun 2004 08:54:46 +0000 |
| Subject: | Re: [SMARTY-DEV] mixing of asign() and assign_by_ref() overwrites external vars | ||
| References: | 1 2 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-2404@lists.php.net to get a copy of this message | ||
Boots schrieb:
[...] It doesn't solve the problem: the original poster was mis-using the feature.:-( i dont think so! is use it in this way: PHP 4.3.6 main() $smarty = new Smarty; // user - object allways, cause its allways needed! $_SESSION['user'] = new User; $smarty->assign_by_ref('user', $_SESSION['user']); // and many other data added to $smarty ... // later i need an template for mail, with the same data $mail = $smarty // except the user-data $mail->assign('user', $user_data_array); mail($mail->fetch....); ... // end of page, display $smarty->display('page.tpl'); page.tpl: ... {$smarty.customer->getID()} ... Raises: Fatal error: Call to a member function on a non-object in ... i have shortened this, i hope i dont forgot relevant things .. -- Sebastian Mendel www.sebastianmendel.de www.warzonez.de www.tekkno4u.de www.nofetish.com www.sf.net/projects/phpdatetime www.sf.net/projects/phptimesheet