CODEIGNITER Interview Questions and Answers

CodeIgniter is a free, light weight,fast and Application Development Framework for building web sites using PHP. It is based on MVC i.e. Model-View-Controller design pattern.It helps us to focus on project by minimizing the amount of code needed for given task..


11) Explain the CodeIgniter library. How will you load it?

CodeIgniter provides a rich set of libraries. It is an essential part of CodeIgniter as it increases the developing speed of an application. It is located in the system/library folder.

It can be loaded as follows:

$this->load->library('class_name');


12) Where is a newly created library stored in CodeIgniter structure?

It should be placed in application/libraries folder.


13) What is routing in CodeIgniter?

Routing is a technique by which you can define your URLs according to the requirement instead of using the predefined URLs. Routes can be classified in two ways, either using Wildcards or Regular Expressions.

Wildcards: There are two types of wildcards:

  1. :num :-> series containing only numbers matched.
  2. :any :-> series containing only characters matched.
Regular Expression: Regular expressions are also used to redirect routes.
  1. $route['blog'(a-zA-Z0-9]+)'] = 'women/social';  

You can create your regular expression to run your URL.