[Solved] Beginner --> Returning a class call
Posted: Sun Sep 07, 2008 6:02 pm
Hi Gang,
I'm new(ish) at PHP, and having a little trouble figuring something. Perhaps best explained by example.
From within the class, $smarty->assign returns a "Call to a member function assign() on a non-object" error. I've tried "return $smarty->assign($key, $value)", but it doesn't seem to have any effect.
The call I'm using in the related page is just
The code works fine when used directly on the page from which I'm (now) trying to call the class. Any suggestions most appreciated.
Lotsa thanks,
- The Goo
I'm new(ish) at PHP, and having a little trouble figuring something. Perhaps best explained by example.
Code: Select all
class queries {
...
...
function assign_smarty($data) {
foreach ($data as $key=>$value) {
$smarty->assign($key, $value);
}
}
}
The call I'm using in the related page is just
Code: Select all
$queries->assign($data)Lotsa thanks,
- The Goo