×

CodeIgniter Helpers

The Helpers (functions) are stored in the Helper file. It helps CodeIgniter to perform different tasks.

The helper file is the collection of many functions that is used to perform specific task. It is divided into small functions to perform different functionalities in the web application.

For example, URL Helpers, Form Helpers, Text Helpers, Cookie Helpers, etc.

Like the other CodeIgniter functions, helpers functions do not follow object-oriented approach because they have not any classes. Instead of this, it creates a simple function to perform a specific task, and each function works independently.

Remember: CodeIgniter does not load any helper file itself, so you are required to load it manually. Once the helper file is loaded, it becomes globally accessible in the controller and views files.

Generally, Helpers are stored in the application folder, or the system/helpers folder. When you load the helper’s file, then CodeIgniter, first checks in application/helper folder. If the folder is not present, or the particular helper file is not existing, then CodeIgniter (CI) checks globally to access the system/helper’s folder.

The Helper folder contains multiple helpers function files. The following tables describes the different helper functions.

Helper name Description
Array Helper This file contains some predefined function that used to work with arrays. Syntax: $this->load-> helper(‘ array ’);  
CAPTCHA helper This file store some function, that used to create captcha images Syntax: $this->load->helper (‘captcha’);  
Cookie helper This file has some method that helps to work with cookies. Syntax: $this->load->helper(‘cookie’);
Date helper This file contains some predefined function that used to work with dates. Syntax: $this->load->helper(‘dates’);
Directory helper This file had some predefined functions which are used to working with directories. Syntax: $this->load->helper(‘directory’);
Download helper It is used to download data on your desktop. Syntax: $this->load->helper(‘download’);
Email helper Itis used to provide a dependent function to work with email. Syntax: $this->load->helper(‘ email ‘);
File helper It contains some file functions to work with files. Syntax: $this->load->helper( ‘file’ );
Form helper It contains some predefined function that’s used to create form and associated operations. Syntax: $this->load->helper->( ‘form’ );
HTML helper This file contains some predefined functions to work with html. Syntax: $this->load->helper( ‘html’ );
Inflector helper This file has some predefined function that allows you to convert English letters or words to plural, singular, camel case, etc. Syntax: $this->load->helper ( ‘inflector’ );
Language helper This file is used predefined function to change the working of the language files. Syntax: $this->load->helper( ‘language’ );
Number helper This file is used to change the numeric data with the use of predefined function in the files. Syntax: $this->load->helper( ‘number’ );
Path helper This file is used some predefined function to declare the file path from their source to the server access. Syntax: $this->load->helper ( ‘path’ );
Security helper This file contains some security-related functions to protect your files from unauthorized access. Syntax: $this->load->helper( ‘security’ );
Smiley helper This file is used to represents the smiley image on an application by calling a text code into the file. Syntax: $this->load->helper( ‘smiley’ );
String helper This file has a function that used to perform string related operations to manage the password and encrypted the data in the server.  Syntax:  $this->load->helper( ‘string’ );
Text helper This helper file contains some functions that are used to changes in working of the text. Syntax: $this->load->helper( ‘text’);
Typography helper This file has some predefined functions to convert its actual text into the application's relevant interface. Syntax: $this->load->helper( ‘typography’ );
URL helper This file contains some function to produce a link and switching in between the files. Syntax: $this->load->helper( ‘url’ );

Related Topics

CodeIgniter ZIP Encoding Class

ZIP Encoding Class The CodeIgniter provides a Zip encoding class that are used to compress a large file into a Zip archives. And this archives files can be downloaded either to your desktop or...

5 minutes read.

CodeIgniter Encrypt Class

The Codeigniter provides an encrypt class used to protect confidential data stored on computer systems or data transmitted over a network. It provides two-way data encryption techniques such as Mcrypt PHP extension and...

4 minutes read.

CodeIgniter Creating Library

As we know, CodeIgniter has a large collection of library functions that are stored in the system/libraries folder. CodeIgniter also provides some additional functionality in library files. For example, if you want to...

3 minutes read.

CodeIgniter Libraries

The library is an important part of the CodeIgniter framework. It has a large collection of libraries files that are used to increase the performance of an application. By default, all CodeIgniter libraries...

4 minutes read.

CodeIgniter Benchmarking Class

The CodeIgniter contains the Benchmarking class that is used to calculate the time difference between two points or the memory usage of the passed statements in the application. By default, the Benchmarking...

7 minutes read.

CodeIgniter URL Helper

The helper file contains some predefined functions that are used to work with URL, such as generate the current file path, transfer control, redirect, create a link, etc. Load the URL Helper Before using...

7 minutes read.

CodeIgniter Text Helper

The text helper contains the various function that is used to operate with text such as define a word limit and characters limit, conversion of word from ASCII to entities, etc. Loading the text...

4 minutes read.

CodeIgniter CAPTCHA Helper

A CAPTCHA (Complete Automated Public Turning test to tell Computer and Humans Apart) helper is a function that is used in web application to check whether the user is human or machine. It...

3 minutes read.

Image Manipulation Codeigniter

Image Manipulation A Codeigniter provides an image manipulation class that is used for resizing, cropping, rotation, and many other manipulation tasks. This class also support three major image libraries such as GD/GD2, NetPBM, and...

11 minutes read.

CodeIgniter Pagination Class

Pagination Class The CodeIgniter framework provides a pagination class that is used in the data list to create pagination links in a web application. Generally, it is used to retrieve data records from...

10 minutes read.

CodeIgniter Calendaring Library

The calendar library contains various functions that are used to create a dynamic calendar. It also enables you to pass the data to calendar cells and 100% control over the calendar design. Load...

7 minutes read.

CodeIgniter Models

Models are the classes that deals with backend operations. It is used to fetch the data from the database and send it to the Controller. All the database related information provided inside...

5 minutes read.

Migration Class CodeIgniter

The CodeIgniter framework provides the migration class that helps the web developers to create and handle databases in a structured and streamlined manner. The migration classes are very useful when more than...

6 minutes read.

CodeIgniter HTML Helper

The HTML helper function is used in CodeIgniter to provide various functionality, such as headings, images, links, list tags, etc. Loading the HTML Helper Before using the html helper function, you must load the...

7 minutes read.

CodeIgniter User Agent Class

User Agent Class The CodeIgniter provides a user agent class that helps to identify and collect information about the browser, mobile devices, or robots visiting your site. Besides this, it is also used...

4 minutes read.

Insert data to the database CodeIgniter

After successfully creating a database connection with the CodeIgniter application, we will now understand how we can insert records into the database. To insert a record into a database table, Codeigniter provides...

8 minutes read.

CodeIgniter Security Helper

A Security helper file contains some predefined functions that are used to protect application from unauthorized access. Loading the Helper The following syntax is used to load the security helper in the CodeIgniter application. Syntax $this-> load->...

4 minutes read.

CodeIgniter Email Class

CodeIgniter provides an e-mail library that helps to send a message from one application to another. You can create and send text messages easily in CodeIgniter application even you can set email...

9 minutes read.

CodeIgniter Array Helper

The Array Helper contains some predefined functions that are used to perform the various operation with array. Load Array helper It is used to load the helper class. We can pass the helper function in the...

6 minutes read.

CodeIgniter Controller

As its name suggest that it is a Controller that controls the web application, and it works as an intermediary between the Models and the View. A controller takes requests from the user...

3 minutes read.