[eluser]mddd[/eluser]
You can. If you use this code in your view.
Code:
$CI =& get_instance();
// $CI can now be used the same as you would use $this in your controller.
// for instance:
$CI->my_library->my_function();
Whether you want to do it this way or a different way is mainly a matter of taste.
Somehow it feels better to me to put the libray call in the controller and pass the data to the view.
I think it's because I like to keep the view as 'dumb' as possible.
For instance:
Code:
// this is in the controller
$this->load->library('my_library');
$data = $my_library->get_my_data();
$this->load->view('my_view', $data);
If you wanted to make that shorter you could autoload the library. You could even set the data from the library using
Code:
$this->load->vars($data); // after this, $data is pushed to every view you load!
This would automate it completely; you wouldn't have to do anything in the controller or the view, to have the data available.