×

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

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.

Installation of CodeIgniter

Before installing CodeIgniter, you need to make sure that the wamp or xampp server in the system is preinstalled. The installation procedure for CodeIgniter is very easy. You can download CodeIgniter by following these...

2 minutes read.

Structure of Codeigniter

The File structure of CodeIgniter is divided into three parts: ApplicationSystemuser_guide Application -: As the name represents Application, which contains all the main parts of the project like a controller, libraries, view, models, and others....

3 minutes read.

CodeIgniter Smiley Helper

The smiley helper file contains smiley images that are used in the application for showing emotions and comments while chatting with others. Load a Smiley Helper Before using Smiley Helper in the CodeIgniter application, you...

4 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 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 Session Library

Session Library The session is an essential part of any application. It contains various functions to manage the users' status and track their activity while browsing on the site. For example,...

13 minutes read.

Directory Helper Codeigniter

Directory Helper CodeIgniter: provides a directory helper function that works with the directory. It shows the structure of the file, hidden file in the folder, and the folder in...

3 minutes read.

Calendaring Class CodeIgniter

Calendaring Class 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...

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

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 Views

A View is a presentational part which shows the information to the users. It is a complex web page which contains navbar, header, footer, sidebar, etc. A view file cannot be called directly...

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

Retrieve data from Database

Retrieve data from the Database Now we will discuss how we can retrieve data from the database that we have inserted to the employees table of the database in our previous topic “inserted...

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

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.

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.