Welcome Guest, Not a member yet? Register   Sign In
Helpers and libraries
#1

[eluser]Aji[/eluser]
Can anyone tell me the difference between libraries and helpers in CI ?
#2

[eluser]davidbehler[/eluser]
Helpers are nothing else than collection of more or less simple functions, most of the time one helper covers one topic, e.g. form generation.

Libraries are classes and offer therefor more functionalities than a simple helper.

But there is nothing stopping you from turning the form helper into a library or the other way round, even though turning a library into a helper is much more complicated if you have class properties and stuff like that.
#3

[eluser]Aji[/eluser]
Thank you for the reply,Now I am clear with that.
#4

[eluser]designfellow[/eluser]
Hi,

Libraries & helpers are just collection of functions.
Libraries are php classes, but helpers are simply a collection of multiple functions.

Libraries are loaded & used like
Code:
$this->load->library('email');
$this->email->to();

And Helpers are loaded & used like
Code:
$this->load->helper('string');
strip_quotes();


Happy Coding,
DesignFellow
#5

[eluser]Aji[/eluser]
Thank you for spending your time in this Grad




Theme © iAndrew 2016 - Forum software by © MyBB