CodeIgniter Forums
Can I use Model function in a plugin? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Can I use Model function in a plugin? (/thread-25964.html)



Can I use Model function in a plugin? - El Forum - 01-02-2010

[eluser]shinokada[/eluser]
I am getting an error with this in plugin.

Code:
$catname = $this->ModelCats->getCategoryNamebyProduct($category_id);

It seems I can't use like $this->Modelname in plugin.

The model is autoloaded.

Can anyone suggest the best way? Do I need to change it to helper or library?


Can I use Model function in a plugin? - El Forum - 01-02-2010

[eluser]Cro_Crx[/eluser]
http://ellislab.com/codeigniter/user-guide/general/creating_libraries.html

ctrl + f "Utilizing CodeIgniter Resources within Your Library"