Module 6 – Library and Helper

Library or Helper?

CodeIgniter provides a rich set of libraries and helpers for commonly needed tasks that will save you a lot of time. What is the difference between Library and Helper? Listen to this video to understand the purpose of both facilities of CI.




Validation Library

CodeIgniter provides a comprehensive form validation and data prepping class that helps minimize the amount of code you’ll write.

Let’s describe the ideal scenario:
1. A form is displayed. You fill it in and submit it.
2. If you submitted something invalid, or perhaps missed a required item, the form is redisplayed with an error message describing the problem.
3. This process continues until you have submitted a valid form.

MEB Validation process with example in this document.




Language Library and Helper

MEB system can be available in French and English. It’s with the creation of the user that you will indicate the language preference.

In your CodeIgniter system folder, you will find a language sub-directory containing a set of language files for the English idiom.  You can create or incorporate your own language files, as needed, in order to provide application-specific error and other messages into other languages.

MEB translation example in this document.

Session Library

Session variables are special variables that exist only while the user’s session with your application is active. Session variables are specific to each visitor to your sites like the language used or even the user code.

Session variables class in CodeIgniter is divided in 2 groups:
1. Flashdata: a temporary variable that will last for only one process like error messages.
2. Userdata: available all the time until you unset the session variable.