Welcome Guest, Not a member yet? Register   Sign In
Use of Helper and libraries
#6

(09-01-2017, 03:16 AM)InsiteFX Wrote: A CodeIgniter helper is a set of related functions (Common functions) which you could
use them within Models, Views, Controllers,.. everywhere. Once you load (include) that file,
you can get access to the functions. But a Library is a class, which you need to make an
instance of the class (by $this->load->library()).

Helpers can be used in any place.

For example I created my own asset_help that allows be to use the
base_url() for resources like css js etc; I autoload the helper and
can use it in my views for setting my css and js paths to the files.

Functions do one thing and do it great, my_function();
Compared to libraries do multiple things with one load instance.
$this->library_name->function();

Easier typing and less memory depending on the size of the files.

Thanks buddy for  details.
Reply


Messages In This Thread
Use of Helper and libraries - by ktmonty - 08-29-2017, 02:31 AM
RE: Use of Helper and libraries - by InsiteFX - 08-29-2017, 10:03 AM
RE: Use of Helper and libraries - by ktmonty - 08-31-2017, 10:38 PM
RE: Use of Helper and libraries - by sasbass - 08-31-2017, 01:59 AM
RE: Use of Helper and libraries - by InsiteFX - 09-01-2017, 03:16 AM
RE: Use of Helper and libraries - by ktmonty - 09-04-2017, 02:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB