[PHP] How do I call a function in a Class from another function in the same class

2003-08-14 Thread Donpro
Hi,
 
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?
 
 
Thanks,
Don

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.507 / Virus Database: 304 - Release Date: 8/4/2003
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How do I call a function in a Class from another function in the same class

2003-08-14 Thread Chris Boget
 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


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php