Welcome Guest, Not a member yet? Register   Sign In
Can plugins have more than one functions?
#1

[eluser]shinokada[/eluser]
I have some functions.

Can I put all functions in one plugin?

Should I create helper instead?
#2

[eluser]davidbehler[/eluser]
Quote:Plugins work almost identically to Helpers. The main difference is that a plugin usually provides a single function, whereas a Helper is usually a collection of functions. Helpers are also considered a part of the core system; plugins are intended to be created and shared by our community.

Taken from the user guide.

I've never used plugins before and propably won't...helper and libraries are just fine and can be shared just as easy as plugins.
#3

[eluser]Sbioko[/eluser]
Sure, you can use as many functions in plugin as you want. Don't forget the main thing - Codeigniter doesn't change PHP. PHP files are still PHP files, not CI specific. You just need to name them right. That's all. So, you can do it freely.
#4

[eluser]Mark Croxton[/eluser]
I'm using plugins to add methods to library classes on the fly. I think it fits with the idea of easily installed functions that can be shared.

For example: I have geolocation, tinymce, file upload and cloning form control plugins that extend an abstract form plugin class and can be loaded and instantiated by my custom form validation class when needed (when a rule is encountered in a form configuration file).

Helpers I only use for utility functions.




Theme © iAndrew 2016 - Forum software by © MyBB