Welcome Guest, Not a member yet? Register   Sign In
Creating self contained libraries
#1

[eluser]a2s2[/eluser]
I'm trying to create a library that deals with authorization and permission.
I want to put this library into my /system folder so all my applications can benefit from it.
This library should access the database, to save new users or to retrieve then. Since /system folder does not have a /model sub-folder inside I cannot use a model inside my library, i.e., I cannot call $this->load->model('User_Model') inside my library class. Actually, it is not a matter of having /model inside /system, because the Loader class uses APPPATH to load models. So, in order to load a model within a library class I should extend the original Loader class to look into BASEPATH when loading models.

Is there a way to accomplish what I'm trying to do? I do not want to put User_Model inside the /application/models folder since I think the library should be self-contained, i.e., everything should exist into the /system folder so I can use the library with all applications without having to put the model into every /application/models directory.

I know I can access the database directly from within my library class, but since I'm using a framework that offers some goodies why can't I use it (the goodies) within my library?

Thanks in advance for any ideas or suggestions.


Messages In This Thread
Creating self contained libraries - by El Forum - 10-01-2009, 03:29 PM
Creating self contained libraries - by El Forum - 10-01-2009, 03:44 PM
Creating self contained libraries - by El Forum - 10-01-2009, 03:52 PM
Creating self contained libraries - by El Forum - 10-01-2009, 03:57 PM
Creating self contained libraries - by El Forum - 10-01-2009, 04:49 PM
Creating self contained libraries - by El Forum - 10-01-2009, 05:00 PM
Creating self contained libraries - by El Forum - 10-01-2009, 05:42 PM
Creating self contained libraries - by El Forum - 10-01-2009, 06:06 PM
Creating self contained libraries - by El Forum - 10-01-2009, 09:04 PM
Creating self contained libraries - by El Forum - 10-02-2009, 02:12 PM
Creating self contained libraries - by El Forum - 10-02-2009, 02:26 PM
Creating self contained libraries - by El Forum - 10-03-2009, 03:40 AM



Theme © iAndrew 2016 - Forum software by © MyBB