CodeIgniter Forums
load library to other libraries - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: load library to other libraries (/thread-72104.html)



load library to other libraries - Sarog - 11-06-2018

Good day!

I have my library Curl.php. And i'm going to load this library to my different libraries.

If i have one library, this situation is:
lib1.php
PHP Code:
$this->ci =& get_instance();
$this->ci->load->library('curl'); 
But if there are several (lib1.php,lib2.php,...)?

Thank you!


RE: load library to other libraries - php_rocs - 11-06-2018

@Sarog,

You could autoload library ( https://codeigniter.com/user_guide/general/autoloader.html?highlight=load%20libraries#auto-loading-resources )


RE: load library to other libraries - InsiteFX - 11-06-2018

load will also take an associated array as input.


RE: load library to other libraries - dave friend - 11-06-2018

(11-06-2018, 10:36 AM)InsiteFX Wrote: load will also take an associated array as input.

I believe that load->library will take an indexed array too. (Or a string of course)