[eluser]Unknown[/eluser]
Hello am a codeigniter newbie and am in love with this frame work. I have hit a snag in controllers where by i want to use a private variable in two controllers like this
Code:
class data extends CI_Controller{
private $somedata;
public function index(){
$this->somedata="Got Data here";
}
public function showData(){
echo $this->somedata;
}
}
In the above code when i run the showData() controller it is always empty (My gues is that the class is instantiated in each page am i right? e.g /home/ and /home/showdata will result in two different classes)
My question is how would i set variables in one controller to accessed in another controller?