CodeIgniter Interview Questions

Page

1.Explain what is CodeIgniter?

Codeigniter is an open source framework for web application.

2.Explain how you will load or add a model in CodeIgniter?

Within your controller functions, models will typically be loaded; you will use the function

$this->load->model (‘Model_Name’);

3.Explain routing in Codeigniter?

In CodeIgniter, the way PHP files served is different rather than accessing it directly from the browser.

This  process is called routing.

4.Explain what are hooks in CodeIgniter?

Codeigniter’s hooks feature provides a way to change the inner working of the framework without hacking the core     files. Usually, it is defined in application/config/hooks.php file.

5.Explain what helpers in CodeIgniter are and how you can load a helper file?

In CodeIgniter, helpers are group of function in a particular category that assist you to perform specific functions.       In CodeIgniter, you will find many helpers like URL helpers- helping in creating links, Text helpers- perform various text formatting routines, Cookies- helpers set and read cookies.  You can load helper file by  using command

$this->load->helper (‘name’);

6.List out different types of hook point in Codeigniter?

Different types of  hook point in Codeigniter includes

  • post_controller_constructor
  • post_sytem
  • pre_controller
  • cache_override
  • pre_system
  • post_controller

7.Explain what is inhibitor in CodeIgniter?

For  CodeIgniter, inhibitor is an error handler class, using the native PHP functions like   set_exception_handler, set_error_handler, register_shutdown_function to handle parse errors, exceptions, and fatal errors.

8.What are the features of codeigniter?

  • Codeigniter is free to use,its an open source framework.
  • Model-View-Controller Based System.
  • Extremely Light Weight.
  • Full Featured database classes with support for several platforms..
  • CodeIgniter is Extensible.The system can be easily extended through the use of your own libraries, helpers, or through class extensions or system hooks.
  • Excelent documentation.
  • Full Featured database classes with support for several platforms,Security and XSS Filtering,Error Logging.

 9.Mention what is the default URL pattern used in Codeigniter framework?

Codeigniter framework URL has four main components in default URL pattern.  First we have the server name  and   next we have the controller class name followed by controller function name and function parameters at the end. Codeigniter can be accessed using the URL helper.

For example                                                                                         http://servername/controllerName/controllerFunction/parameter1/parameter2.

10.Why is there a need to configure the URL routes?

Changing the URL routes has some benefits like

  • From SEO point of view, to make URL SEO friendly and get more user visits
  • Hide some URL element such as a function name, controller name, etc. from the users for security reasons
  • Provide different functionality to particular parts of a system

 

 

 

 

 

 

 

 

 

 

 

Leave a comment