creating my own library |
[eluser]a77icu5[/eluser]
Why mongo_db library is not loading? Code: class Mongo_Models {
[eluser]a77icu5[/eluser]
print_r($CI->load) it's ok, I can see the description of the object, but why CI can't find my mongo_db library? why I can make an autoload of mongo_db but I can't load the library inside my own library?
[eluser]Clooner[/eluser]
What are you trying to accomplish here? Is the mongo_db already loaded using the autoload functionality? Loading a library works different than a class try it like so Code: $this->load->library('mongo_db', 'mongolib') Then you would be able to make it available under $this->mongo as such Code: $this->mongo =& $CI->mongolib Please see the userguide about this topic http://ellislab.com/codeigniter/user-gui...aries.html
[eluser]Aken[/eluser]
You're loading it fine - you're just confused because $this->load->library() doesn't actually return the library instance. It's assigned to A CI property, as Jeroen explained. Reference that and you're golden. |
Welcome Guest, Not a member yet? Register Sign In |