NYCPHP Meetup

NYPHP.org

[nycphp-talk] Accessing Properties in PHP OOP

randal rust rrust at r2communications.com
Thu Aug 26 10:18:33 EDT 2004


Scott Mattocks wrote:

> It is better because this allows each instance of client to have its own 
> instance of display and validator. It will let each client display 
> things they way they want without interfering with other client objects.

Thanks for explaining. That makes sense to me now.

> No! The constructor (function Client()) is the only one that needs to do 
> this. It is setting the members of the class so that they will be 
> alvailable in _all_ methods of the class. Once $this->display is 
> assigned you can use it in any method of the class.

OK, so I added the client() function, which acts as my constructor. 
Then, in my PHP page, I added...

$client->client();

... which sets everything up so that it can be used by the instance of 
the object, right?

I'm guessing so, since it's working.

-- 
Randal Rust

R.Squared Communications
http://www.r2communications.com
Digital Design for Bricks-and-Mortar Businesses




More information about the talk mailing list