CodeIgniter Forums
Using a model in a plugin - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Using a model in a plugin (/showthread.php?tid=29573)



Using a model in a plugin - El Forum - 04-14-2010

[eluser]TheServant[/eluser]
I apologise if this has already been discussed, but I cannot find it.

My structure is this:
I have one Controller which will take a page request, run a corresponding plugin (a unique on for each page) and then serve the view returned by the plugin.
I used a plugin instead of a library because a library should be stand alone and generally a collection of functions rather than one.

However, I have realised that the plugin cannot use models loaded from the controller? I also cannot load a model in the plugin? Am I just doing something wrong or are plugins not meant to be used this way?


Using a model in a plugin - El Forum - 04-14-2010

[eluser]TheServant[/eluser]
Found the answer: http://ellislab.com/forums/viewthread/140091/