• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.