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

[eluser]Unknown[/eluser]
Hello comrades,

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


Plugin is autoloaded in config.

Code:
$CI = & get_instance();
$CI->facebook->api($param)

This is not worked.
#2

[eluser]WanWizard[/eluser]
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.
#3

[eluser]wiredesignz[/eluser]
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.

Code:
$this->load->plugin('a_plugin');

$this->a_plugin = new A_plugin();
#4

[eluser]Unknown[/eluser]
Thank you!!! Smile




Theme © iAndrew 2016 - Forum software by © MyBB