Re: pear auth loginfunction problem

From: Date: Tue, 29 Jul 2003 11:44:15 +0000
Subject: Re: pear auth loginfunction problem
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-6892@lists.php.net to get a copy of this message
Maybe you could use an array as mentioned in the PHP docu (http://de.php.net/manual/en/function.call-user-func.php). Thus using array(&$class,function) as the parameter. -- Alexander _________________________________ Alexander Czernay IT-Consulting & Media Development fon +49-40-41096742 fax +49-40-41096743 icq 4773650 alexander@czernay.com www.czernay.com _________________________________ Maakku Nurkkala wrote:
Hello, I am trying to integrate PEAR AUTH module into my application. I have a login method inside a class that is used to generate the login html. If I try to pass the method name as the login function parameter like this: $auth = new Auth("DB",$options, $this->view->display($error ="")); But it doesn't work because my loginfunction $this->view->display($error ="") is a method of a class, not an independent function and thus the Auth.php following if statement of Auth constructor will never be true: if ($loginFunction != "" && function_exists($loginFunction)) { ........ If the if clause contained a method_exists statement, there would be some chances that it worked. Is there a way to work around this, like "fool" the application that my method is a function or something else? Any examples that I could look at? I do not want to change my class-based code back into procedural code. Regards, Maarit _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus
-- _________________________________ Alexander Czernay IT-Consulting & Media Development fon +49-40-41096742 fax +49-40-41096743 icq 4773650 alexander@czernay.com www.czernay.com _________________________________

« previous php.pear.general (#6892) next »