• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
private variable append not persistent

#1
[eluser]OttoVanzig[/eluser]
hi everybody,
I don't find the way to modify a private variable value and retrieve it in another method;
My issue :
Code:
class .. extend CI_C...
private $var;

function ..() {
  parent::__construct();
//here I load $var
$this->var[] = 'ok';

function modify()
//here I append $var
$this->var[] = 'more';

function another()   //with AJAX call
//if I check $var value, the value 'more' is not set, only 'ok';
So is there a way to append $var outside from the constructor and have it updated in the whole class ?
thanks for your help


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.