Welcome Guest, Not a member yet? Register   Sign In
How can I set variables for an entire constructor?
#1

[eluser]Nicholas Helke[/eluser]
Hi!

I have a post constructor which handles all posts to the database. There are three arrays that I want to be able to access in all the different functions of the constructor.

Set these in the class class constructor doesn't let me access them from the functions using just their name. If there is a way, I don't know it.

Thanks,

Nicholas
#2

[eluser]Crafter[/eluser]
Assign the values to variables with class scope
Code:
class Category extends Controller {

var $var1;

function one() {
  $this->var1 = 'one';
}

function two() {
  $this->var1 = 'two';
}

}
#3

[eluser]Nicholas Helke[/eluser]
Thank you very much!

Problem solved.




Theme © iAndrew 2016 - Forum software by © MyBB