Access to model functions throught custom library |
Hi everybody!
I am not strong in English so please excuse me in advance if it is not very clear. I'm creating my own library for authentication of my users but the problem is that apparently, it is impossible to access the to models functions from the library. So it's impossible for me to do something like PHP Code: $this->CI->zauth_model->get_by('email', $email) Is it me who does it badly or there is another way to do it? Thank you
Simplicity is the ultimate sophistication
Or you can add this method to a CodeIgniter helper .
PHP Code: /** What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(01-19-2018, 11:22 AM)LEBOSSS Wrote: Hi everybody! That will work if CI has the right value. This is the usual way to do that. PHP Code: class Example
This is a code piece from CI itself. It is used in the CI_Model.
PHP Code: /** Just place it in any class that requires the use of the CI super object. Advantage of this approach is that you can keep coding like you would in your controllers |
Welcome Guest, Not a member yet? Register Sign In |