Welcome Guest, Not a member yet? Register   Sign In
Problem when to load library in model
#1

Hi!

In the file autoload.php the var $autoload['libraries'], I load a library generated by me, the name of this library is datetime. In a model I try to load this library ($this->datetime), If it worked in Codeigniter 2.x, but in Codeigniter 3 not working, the var $this in the model execute el magic method.

What I have to do to access the library from the model?

Thanks.

Carlos V
Reply
#2

(02-21-2016, 04:15 AM)carlos.vv Wrote: What I have to do to access the library from the model?

Nothing has change in CI3, it should work the same way as in CI2. Double check all the steps to migrate from CI2 to CI3. Something must be wrong (UCfirst filename perhaps?)
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply
#3

(This post was last modified: 02-27-2016, 11:19 AM by skunkbad.)

Just a thought. Since PHP already has a Datetime class , maybe naming a class with the same name is bad. Does it work if you rename it?
Reply




Theme © iAndrew 2016 - Forum software by © MyBB