Page 1 of 1
Help on $this->
Posted: Tue Oct 07, 2003 1:42 pm
by ravenance
Alright I have seen this around, and I have no been able to figure out how it works and have not been able to find documentation anywhere.
Can anyone help me by linking me to an explanation, or an example? Or explain how. It would be greatly appreciated thanks!
-ravenance
Posted: Tue Oct 07, 2003 2:01 pm
by mudkicker
This is mostly a part of Object Oriented Programming in PHP. You can use these links below:
http://www.php.net/manual/en/language.oop.php
http://www.devarticles.com/art/1/349
Posted: Tue Oct 07, 2003 5:12 pm
by ravenance
Thanks a ton man, I am gonna read and try to comprehend it =)
-ravenance

Posted: Tue Oct 07, 2003 5:15 pm
by mudkicker
you are welcome.
i think these are the most valuable articles and manuals for this subject, i really show respect to them

Posted: Tue Oct 07, 2003 6:10 pm
by McGruff
Inside a class definition, $this just means "this class".
$this->var; is a class property.
$this->doSomething(); runs a class method.
$this->object =& new Object($this); is interesting. Instantiates a new class (as a property of $this) and passes $this to the new object, ie you can pass $this as an argument if you need to (inside the class definition).