×

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 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 Form Helper

A form helper file contains different functions that works with forms. It is used to create various functionality in a form such as dropdown, radio button, password, upload, hidden data, etc. These functionalities...

12 minutes read.

Update a Record CodeIgniter

Update a record In this topic, we will learn how we can update existing records in database tables. To update a record, CodeIgniter provides an update() function used with the set()...

10 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 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.

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 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 String Helper

The string helper file contains functions that allows separate operations with strings in CodeIgniter. Loading the String Helper Before using the string helper in the CodeIgniter application, you must load it in the controller...

7 minutes read.

CodeIgniter Number helper

The number helper file contains some predefined function that deals with numeric data to display numbers in bytes format. Load a Number Helper You must load a number helper file in the controller to perform...

3 minutes read.

Download Helper Codeigniter

Download Helper Codeigniter: The download helper function is used to download data from the server to your computer. The data can be any format like text, jpg, mp3, mp4, etc. Loading...

2 minutes read.

CodeIgniter File Helper

The file helper function is used to perform various tasks with files such as accessing files, writing data to files, deleting files, and more. Loading the File Helper Before using the file helper, you must...

7 minutes read.

HTML Table Class CodeIgniter

HTML Table Class The CodeIgniter framework provides an HTML Table Class that is used to develop an auto-generated table using a defined array or result sets of the database table. Loading an HTML Table Class...

8 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.

Database Configuration CodeIgniter

In every application, there is an important part of a database through which developers can connect an application to store users’ data and perform various functions in the database application such as inserting,...

10 minutes read.

Form Validation Library Codeigniter

Form Validation Library The Codeigniter provides a form validation library that contains predefined rules to validate the form fields. It also helps in optimizing the form validation code, which reduces the effort and time...

31 minutes read.

CodeIgniter Input Class

Input Class The CodeIgniter framework provides an input class that includes various input functions to pre-process global input data for protection; furthermore, it also provides some helper functions to obtain input data. This...

11 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 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 Language Class

Language Class The CodeIgniter’s language class contains the various functionality that is used to access the language-specific files and text line for the purposes of internationalization. This class provides you suitability to add or...

4 minutes read.

CodeIgniter Routes

The Routes are used to handle URL requests on the browser. It matches the URL request to the predefined routes in CodeIgniter. Therefore, a file must be predefined as a routes.php file to...

6 minutes read.