Welcome Guest, Not a member yet? Register   Sign In
How to use plugin from a model

Hello comrades,

I have a some question... How to use plugin from a model?

Plugin is autoloaded in config.

$CI = & get_instance();

This is not worked.

A plugin is a standard PHP function (or functions), not an object. For this to work it has to be a library.

I would advice against plugins anyway, they are deprecated, CI 2.0 doesn't support them anymore.

Considering that CI2.0 is not officially released yet and that many people still use CI 1.7 you should understand that plugins are not instantiated by CI, you can load a plugin using the loader or simply include it as per normal PHP, but you must also instantiate and assign the object to a variable yourself.


$this->a_plugin = new A_plugin();

Thank you!!! Smile

Theme © iAndrew 2016 - Forum software by © MyBB