Re: Auth - losing context
| From: | bertrand Gugger | Date: | Thu, 07 Jul 2005 06:35:05 +0000 |
| Subject: | Re: Auth - losing context | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-19888@lists.php.net to get a copy of this message | ||
Hi !
Ed Greenberg wrote:
This may be a more general OO question than an Auth question, but I hope somebody will know the answer. Up at the top of my script, I do: $a=new Auth(...) Later on, I instantiate a class and call one of it's methods. Down in the method, I need to do a checkLogin() to see if the user is logged in. Then I'm going to do a getUsername(). well, $a is out of context since I'm in a method, but it's there in $GLOBALS, so I do $a=&$GLOBALS['a']; $loggedin = $a->checkLogin();is it not checkAuth() ?
What I get is 'call to undefined function: checklogin()' I can see the object's members in the debugger (Zend) but what happened to it's binding to it's code? There must be a better way that I'm missing. Does anybody know? Thanks, </edg> à+-- bertrand "toggg" Gugger