Dear CodIgnitor members,
I have the problem with CodeIgnitor when I want to declear the variable in the class controller.
Could you explain me?
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
June 22, 2009 10:49pm
Subscribe [2]#1 / Jun 22, 2009 10:49pm
Dear CodIgnitor members,
I have the problem with CodeIgnitor when I want to declear the variable in the class controller.
Could you explain me?
#2 / Jun 22, 2009 10:53pm
Dear CodIgnitor members,
I have the problem with CodeIgnitor when I want to declear the variable in the class controller.
Could you explain me?
what do you mean by declear?
#3 / Jun 22, 2009 10:54pm
since every request in CI revolves around a single controller, rather than creating a global variable you can simply just create a property of the controller
i.e. if previously you wanted to create a global variable like this
global $myvar;
$myvar = 'abc';try doing this instead
$this->myvar = 'abc';Then if you want to access this in the model, libraries etc
$CI =& get_instance();
echo $CI->myvar;#4 / Jun 22, 2009 10:55pm
Dear CodIgnitor members,
I have the problem with CodeIgnitor when I want to declear the variable in the class controller.
Could you explain me?what do you mean by declear?
so it’s declare. I was leaning to the ‘opposite of clear’ option 😛
#5 / Jun 23, 2009 12:30am
Dear CodIgnitor members,
I have the problem with CodeIgnitor when I want to declear the variable in the class controller.
Could you explain me?what do you mean by declear?
so it’s declare. I was leaning to the ‘opposite of clear’ option 😛
We are also “CodIgnitors” so we must be setting fish on fire…