RE: [PHP] add functions to a class

2006-09-21 Thread Ford, Mike
On 21 September 2006 10:19, Thomas Munz wrote: > This will not work. > > $this->bla(); > > This is a PHP Syntax and tries to get the Class method, PHP dont look > for a variable name at all! > > It seams me strange also, that you try this, you should create the > method for the class itself, o

Re: [PHP] add functions to a class

2006-09-21 Thread Thomas Munz
This will not work. $this->bla(); This is a PHP Syntax and tries to get the Class method, PHP dont look for a variable name at all! It seams me strange also, that you try this, you should create the method for the class itself, or extend it. But this shoul work: class Test { function Test

[PHP] add functions to a class

2006-09-21 Thread Kelsang Tsenle
Hi all, I tried to add functions to a class, but it doesn't seem to work. Here's an example: writeFoo = $writeFoo; $this->writeFoo (); } } $test = new Test (); ?> This outputs: foo. foo. PHP Fatal error: Call to undefined method Test::writeFoo() in /test.php on line 11 Both $writ