I have a controller in CodeIgniter like this
class C extends CI_controller {
public function A()
{
var $data;
}
public function B(){
//here i need to access the variable $data;
}
}
How to do that in CodeIgniter? I can use a session. Is it really a good thing to assign that variable in a session? Is there any better way to declare the global varaibles?
i used like this but not working y
class C extends CI_controller {
public $data;
public function A()
{
$this->data=1;
}
public function B(){
//here $this->data showing null value y
}
}