Re: How do I call a function in a Class from another function in the same class
| From: | Chris Boget | Date: | Tue, 12 Aug 2003 16:53:59 +0000 |
| Subject: | Re: How do I call a function in a Class from another function in the same class | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-159297@lists.php.net to get a copy of this message | ||
> I have two functions in a class where one calls the other. When creating my
> object I get an error:
> "Call to undefined function"
> I dont understand why the function can't be seen?
You'll need to prepend "$this->" to the function call.
class bob {
function firstFunction() {
}
function secondFunction() {
$this->firstFunction();
}
}
Chris