Check session from view in CodeIgniter

What is the best way to test a session from a view in CodeIgniter, it doesn’t show the way in their user guide, otherwise I will have to make two representations about everything that is curiously strange ... still new to CodeIgniter ...

Please, help! Thanks...

+5
source share
2 answers

Load it into the view, like any other piece of data ...

$data['item'] = $this->session->userdata('item');
$this->load->view('view', $data);
+13
source

, . , :

<?php echo $this->session->userdata('session_key'); ?>

, , :

<?php
$CI =& get_instance();
$CI->load->model('some_model');
echo $CI->some_model->some_function($some_param);
?>

, , , ..

.

+7

All Articles