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 are stored at the system/libraries folder. If you want to use any of the libraries’ classes, you need to load it at the controller file by using the following method.
$this-> load-> library ('library class name ');
The library files enables you to load many library classes into a controller; for this, you need to pass an array argument to the library() function and define the class names you want to load into the library.
For example:
$this->load-> library (array (' form validation', 'cache ',' typography '));
Library Classes
By default, all the library classes are stored in the system/libraries folder. Each class has different functionality that makes it easier to use the CodeIgniter application. The Library folder contains several library classes and its descriptions, which are shown in the following table.
Libraries Names | Description of Library classes |
Benchmarking Class | By default it is active in the Codeigniter application, which is used to calculate the time difference between any two marked points. |
Caching Class | As we know, cache classes have some methods that are used to quickly fetch web pages from the server. And if you are working with file-based caching, it needs specific server requirements. If the server requirements are not satisfied, it will throw an exception. |
Calendaring class | It is used to create a dynamic calendar in your web application. |
Shopping Cart Class | It helps users to add or remove the items from the shopping cart while shopping online. The items added in the cart remain active during the entire session, |
Config Class | It allows you to set and retrieve configuration preferences. By default, these preferences are set in the application/config/config.php. |
Email Class | It includes various functions that enable you to send and receive emails in the Codeigniter application. |
Encryption Class | It can provide a two-way data encryption technique. Before using the encrypt class, your system must have a Mcrypt PHP extension. |
File Uploading Class | It is used to perform various functions related to the file uploading. It allows the user to set file-related preferences such as file uploading, file size, the format of files, etc. |
Form validation Class | It includes various validation functions that are used to validate the form. |
FTP Class | It has various FTP functions that allow files to be transferred to remote servers. A remote file can also be updated, renamed, and deleted from the server. |
Image manipulation Class | As the class name defines, it is used to manipulate an image such as compress, crop, rotate, thumbnail creation and watermarking, etc. |
Input Class | It is used to preprocess input data globally for security purposes. It also uses some helper functions that are used to receive input data and to pre-process it. |
Language Class | It includes some predefined functions that are used to define language files and text that can be retrieved for internationalization purposes. |
Loader Class | As the name suggests, loaders are used to load various elements such as view files, helpers, drivers, models, and custom files. |
JavaScript Class | It contains predefined functions that allow it to work with JavaScript. |
Migration Class | It includes some functions that allow for updating your database in a structured and organized way. |
Output Class | As the name suggests, the class is used to send web page output to the requested browser. The Output class caches the web pages to be sent to the server. |
Pagination Class | It helps in creating pagination functionality on the web page to move from one page to another in the browser. |
Template Parser Class | It contains some method that is used to substitute a simple text to the pseudo-variable format that contained in view files. |
Security Class | As the name suggests, the class is used to build a secure web application. And it safely processes all input data with the use of XSS filtering, CSRF, class references, and more. |
Session Class | It allows an application to maintain user session data and track their activity while they are browsing your site. |
HTML table | As the name defines, this class is used to create an html table from an array or database automatically. |
Trackback data | It has contains predefined functions that allow the user to initialize a class, create a trackback table, perform a trackback process, send and receive trackback data, and so on. |
Typography Class | It contains functions that help to change the format of the text. |
Unit Testing Class | As the name suggests, unit testing is a method of testing each module of the software, and test cases are written for each module to remove bugs and make error-free software. |
URI Class | It contains some methods that are used to fetch a piece of information from a URI string. A URI routing enables you to obtain information from re-routed segments. |
User Agent Class | It includes some predefined functions that help the developer to identify information about mobile devices, browsers, robotic activities, etc. coming to the site. |
XML-RPC and XML-RPC Server Classes | The class of CodeIgniter helps the user to send a request to another server and also creates its own XML-RPC server to receive the request. |
Zip Encoding Class | It allows the user to create zip archives of your data in the system. The archives file can be downloaded to your desktop or saved to the system directory. |