[eluser]coolamit[/eluser]
"$this" object is not available in views. So you need to pass it in the data array when loading the view like this:
Code:
$data = array();
//... load up variables in data array to pass into view
$data['objCI'] = $this;
$this->load->view('myview', $data);
& then you can use it like this in view
Code:
$objCI->session->userdata('myvar');
Or you can just pass the session object to the view like:
Code:
$data = array();
//... load up variables in data array to pass into view
$data['objSession'] = $this->session;
$this->load->view('myview', $data);
& then you can use it like this in view
Code:
$objSession->userdata('myvar');
Or you can get the CI instance in the view like this
Code:
$objCI =& get_instance();
//now CI object can be used
$objCI->session->userdata('myvar');