Welcome Guest, Not a member yet? Register   Sign In
how to load a library from another librarie
#1

[eluser]frietkot[/eluser]
Hi,

I've made a library called MY_Upload, handeling image uploading and stuff and extending the CI_Upload class.
But now I want to use another native library in my self made library (the image_lib library).

How do I load another library in my MY_Upload library?
Is it even posible?
#2

[eluser]davidbehler[/eluser]
You can use this for loading libraries inside another library
Code:
$CI =& get_instance();
$CI->load->library('library_name');
and then you can use the library doing this
Code:
$CI->library_name->function_name();

That should work.
#3

[eluser]Bramme[/eluser]
When you're extending existing CI Libraries, there usually allready is a $this->CI variable you can use to load libraries. waldmeister's code would change into:
Code:
$this-CI->load->library('library_name');

$this->CI->library_name->function_name();




Theme © iAndrew 2016 - Forum software by © MyBB