Welcome Guest, Not a member yet? Register   Sign In
Can libraries have models and controllers?
#1
Heart 

Hello guys!

Let's say you have a library called auth, this sits in:
PHP Code:
application/libraries/auth/auth.php 

Now, this is the library class which you can obviously load by doing: (which works perfectly)
PHP Code:
$this->load->library('auth/auth'); 

Now, can I have some folders in this library:
PHP Code:
application/libraries/auth/models
application
/libraries/auth/controllers 

With these folders Is it possible to load a model that is inside the models directory? I just want to keep my files together without having to put all my models in the models folder. As I would like to keep them within the library.

This way inside auth.php maybe I could do:
PHP Code:
$CI->load->model('auth_model'); 

which is located in:
PHP Code:
application/libraries/auth/models/auth_model.php 

I'm hoping there is a way to do this, let me know thanks

Matt
Reply


Messages In This Thread
Can libraries have models and controllers? - by mdixon18 - 04-10-2015, 01:08 PM



Theme © iAndrew 2016 - Forum software by © MyBB