Welcome Guest, Not a member yet? Register   Sign In
[2.0.1] Accessing a library from a model: library is NULL
#1

[eluser]Fabdrol[/eluser]
Hi guys,

I'm autoloading a library called 'storage', and I want to use it in my model. However, I can't access it since: the library returns null:
Code:
var_dump($this->storage); // returns NULL
When I try the same thing from the Controller, it does work, so there's nothing wrong with my library.
Is this a Bug, or a feature, in CI 2? And, how can I circumvent it?

Thanks,

Fabian
#2

[eluser]InsiteFX[/eluser]
You need to use the CI Super Object in a model

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB