well, perhaps I'm not seeing what it is that you're looking for. The
page I sent you is a basic introduction to classes and OOP in PHP,
which based on the example that you've provided seemed like what you
wanted. It seems obvious that you want to learn more about OOP, but
are you trying to find a
well, perhaps I'm not seeing what it is that you're looking for.
No, I'm not sure you are. Take a look at my sample code again. Pay
particular attention to how both $bob and $Bob are defined.
class MyClass {
private $bob;
public $Bob {
set( $var ) {
$this-bob = $var;
}
ok, so if we were talking Java, perhaps you are looking for
information that allows you to build 'accessor' and 'mutator' methods?
If so, then your example should work (syntax aside). Here's another
'test' example that I just whipped up and tested that shows you can
use any method name you wish.
PHP has __set and __get in some versions...
I think that's what you are looking for.
If you told us which particular feature in that pile of code you're
asking about, it would help...
I still wouldn't know the answer, as I don't do OOP in PHP much, but
somebody might.
On Fri, September 22,
PHP has __set and __get in some versions...
I think that's what you are looking for.
Yes, but exactly. They'll do if there is no other way (as below)...
If you told us which particular feature in that pile of code you're
asking about, it would help...
the ability to set an accessor like
5 matches
Mail list logo