• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to call my function into plugin?

Hi all,

I created one function into my model.
class Mymodel extends Model
function Mymodel()
function myfunction()
Normally we call
$this->mymodel->myfunction();// like this. but how do i call inside plugin?
Now I want to call myfunction function into my plugin.
how can i call this function into my plugin?
pls advice me.


In plugins en helpers, you must first get a reference to the CodeIgniter object. Then you can call that object in stead of '$this'.
$CI =& get_instance();

However helpers and plugins are mostly meant for providing simple functions that don't need to reference models etc.
If you need access to your model, you might as well put the "plugin" function inside your model!

Hi ,

Thanks to you.

thanks for immediate reply

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.