Well, this is not the first time I am having problems with communicating between models to other models and libraries.
The last time I saw this kind of “bug” was when I wanted to call a model from another model, it didn’t work. But a little change in the loader library fixed it.
Now I am standing against a bigger problem.. Which I partly solved.
When I am loading a library (in this case form validation) in the constructor of a model I can’t use it right away.
In order to use I muse run this code immediately after loading it:
I went deep to the code and found out that every model name is assigned into an array, and whenever loading a new model or library CI goes over that array and calls _assign_libraries() for each one of these models.
The problem is that because I loaded the library in the constructor, it is not yet in that array, and therefore not included in the foreach loop.
So, I needed to manually call the method, but maybe we can find another-better solution for this problem.
Thanks for reading!