Welcome Guest, Not a member yet? Register   Sign In
Having trouble using libraries in model (libraries are loaded into controller's construct)
#1

[eluser]Unknown[/eluser]
Hey all, from what I understand I can use libraries in models as long as the instance of that model I am using has the controller using it load the libraries. I have auto loaded the database class in autoload.php. I also call encrypt in the controller. I autoload database and then call encrypt $this->load->library('encrypt') in my controller. However when I load my model and try to use database or encrypt it cannot find those libraries, so for the time being I have to use $this->CI = get_instance();. My model is a public class and the properties as well as the methods are public so it is not a scope problem. Am I missing anything?

I need to use the database class and the encrypt class in my model. This has never happened before.




Theme © iAndrew 2016 - Forum software by © MyBB