Welcome Guest, Not a member yet? Register   Sign In
Vars in models
#3

[eluser]xwero[/eluser]
If you want to store data that has to be used by multiple methods you add variables to the beginning of the class. If they are public (all var defined variables are) you can change them form outside the class if you wanted to
Code:
$this->image_lib->width = 200;
// is the same as
$config['width'] = 200;
But with the previous example you don't have the advantage of the checks in the initialize method.

It's powerful stuff if you use it right.


Messages In This Thread
Vars in models - by El Forum - 02-10-2008, 01:46 PM
Vars in models - by El Forum - 02-11-2008, 07:43 AM
Vars in models - by El Forum - 02-11-2008, 08:13 AM
Vars in models - by El Forum - 02-11-2008, 10:06 AM
Vars in models - by El Forum - 02-11-2008, 02:25 PM



Theme © iAndrew 2016 - Forum software by © MyBB