dotkpay Posted September 1, 2011 Share Posted September 1, 2011 Hello, Is it possible to use variables that are declared outside or plainly within a class, and if its possible, how? thanks in advance Quote Link to comment Share on other sites More sharing options...
Psycho Posted September 1, 2011 Share Posted September 1, 2011 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.