Jump to content

OOP outside variables


dotkpay

Recommended Posts

If you need to utilize values set outside a class within the class, then you should pass those variables into the class - using a setter method. As for "plainly within a class", not 100% sure what you mean, but the values should be "properties" of the class and then you can set the value anywhere in the class using $this->varname

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.