At 4:53 PM -0800 1/18/01, Blaine Grady wrote:
>Suppose I have:
>      $method = "doIt";
>inside a class.  How do I construct the statment, using $method, to
>call:
>      $this->doIt();
>I tried every combination I can think of but I keep getting "Call to
>unsupported or undefined function" when doIt() is a proper method.  I
>have no problem with standard functions.
>Thanks for any help.
>


Did you think of

class foo {

function bar() {

        $method = 'doIt';

        $this->$method('yes');

}

function doIt($Answer) {

        echo "Noodles are happy? $Answer";

}

}


It's been awhile, but I believe that should work. If not, give us more info:

What version of PHP?

What, exactly, DID you try?


        - steve

-- 
+--- "They've got a cherry pie there, that'll kill ya" ------------------+
| Steve Edberg                           University of California, Davis |
| [EMAIL PROTECTED]                               Computer Consultant |
| http://aesric.ucdavis.edu/                  http://pgfsun.ucdavis.edu/ |
+-------------------------------------- FBI Special Agent Dale Cooper ---+

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to