Today Deal

what is helper and how to load helper?

Helpers is type of file that help you with tasks.Each helper file is simply a collection of functions in a particular category.They are simple, procedural functions.Each helper function performs one specific task, with no dependence on other functions.

CodeIgniter does not load Helper Files by default, so the first step in using a Helper is to load it. Once loaded, it becomes globally available in your controller and views.

Helpers are typically stored in your system/helpers, or application/helpers directory 

In CodeIgniter, you will find many helpers like URL helpers- helping in creating links, Text helpers- perform various text formatting routines, Cookies- helpers set and read cookies. 

Loading a helper file is quite simple using the following method:

$this->load->helper('name');

Where name is the file name of the helper, without the .php file extension or the “helper” part.

No comments:

Post a Comment

Why configure the URL routes?

Changing the URL routes has some benefits like From SEO point of view, to make URL SEO friendly and get more user visits Hide some URL ...