Interview Questions

AJAX Interview Questions Android Interview Questions Angular 2 Interview Questions AngularJs Interview Questions Apache Presto Interview Questions Apache Tapestry Interview Questions Arduino Interview Questions ASP.NET MVC Interview Questions Aurelia Interview Questions AWS Interview Questions Blockchain Interview Questions Bootstrap Interview Questions C Interview Questions C Programming Coding Interview Questions C# Interview Questions Cakephp Interview Questions Cassandra Interview Questions CherryPy Interview Questions Clojure Interview Questions Cobol Interview Questions CodeIgniter interview Questions CoffeeScript Interview Questions Cordova Interview Questions CouchDB interview questions CSS Buttons Interview Questions CSS Interview Questions D Programming Language Interview Questions Dart Programming Language Interview Questions Data structure & Algorithm Interview Questions DB2 Interview Questions DBMS Interview Questions Django Interview Questions Docker Interview Questions DOJO Interview Questions Drupal Interview Questions Electron Interview Questions Elixir Interview Questions Erlang Interview Questions ES6 Interview Questions and Answers Euphoria Interview Questions ExpressJS Interview Questions Ext Js Interview Questions Firebase Interview Questions Flask Interview Questions Flex Interview Questions Fortran Interview Questions Foundation Interview Questions Framework7 Interview Questions FuelPHP Framework Interview Questions Go Programming Language Interview Questions Google Maps Interview Questions Groovy interview Questions GWT Interview Questions Hadoop Interview Questions Haskell Interview Questions Highcharts Interview Questions HTML Interview Questions HTTP Interview Questions Ionic Interview Questions iOS Interview Questions IoT Interview Questions Java BeanUtils Interview Questions Java Collections Interview Questions Java Interview Questions Java JDBC Interview Questions Java Multithreading Interview Questions Java OOPS Interview Questions Java Programming Coding Interview Questions Java Swing Interview Questions JavaFX Interview Questions JavaScript Interview Questions JCL (Job Control Language) Interview Questions Joomla Interview Questions jQuery Interview Questions js Interview Questions JSF Interview Questions JSP Interview Questions KnockoutJS Interview Questions Koa Interview Questions Laravel Interview Questions Less Interview Questions LISP Interview Questions Magento Interview Questions MariaDB Interview Questions Material Design Lite Interview Questions Materialize CSS Framework Interview Questions MathML Interview Questions MATLAB Interview Questions Meteor Interview Questions MongoDB interview Questions Moo Tools Interview Questions MySQL Interview Questions NodeJS Interview Questions OpenStack Interview Questions Oracle DBA Interview Questions Pascal Interview Questions Perl interview questions Phalcon Framework Interview Questions PhantomJS Interview Questions PhoneGap Interview Questions Php Interview Questions PL/SQL Interview Questions PostgreSQL Interview Questions PouchDB Interview Questions Prototype Interview Questions Pure CSS Interview Questions Python Interview Questions R programming Language Interview Questions React Native Interview Questions ReactJS Interview Questions RequireJs Interview Questions RESTful Web Services Interview Questions RPA Interview Questions Ruby on Rails Interview Questions SAS Interview Questions SASS Interview Questions Scala Interview Questions Sencha Touch Interview Questions SEO Interview Questions Servlet Interview Questions SQL Interview Questions SQL Server Interview Questions SQLite Interview Questions Struts Interview Questions SVG Interview Questions Swift Interview Questions Symfony PHP Framework Interview Questions T-SQL(Transact-SQL) Interview Questions TurboGears Framework Interview Questions TypeScript Interview Questions UiPath Interview Questions VB Script Interview Questions VBA Interview Questions WCF Interview Questions Web icon Interview Questions Web Service Interview Questions Web2py Framework Interview Questions WebGL Interview Questions Website Development Interview Questions WordPress Interview Questions Xamarin Interview Questions XHTML Interview Questions XML Interview Questions XSL Interview Questions Yii PHP Framework Interview Questions Zend Framework Interview Questions Network Architect Interview Questions

Top 30 CodeIgniter interview Questions for 2020

1) What is CodeIgniter?

CodeIgniter is an open source PHP framework. It is used to develop web applications and websites. It is loosely based on MVC pattern and easy to use in compare to other PHP framework.

2) Who developed CodeIgniter?

CodeIgniter was developed by EllisLab company.

3) What is Stable version of CodeIgniter?

CodeIgniter's stable version is: 3.1.5 on 20 March 2016.

4) What are the features of CodeIgniter?

CodeIgniter provides various features like:
  • Open source framework
  • Light Weight
  • CodeIgniter is Extensible
  • Full Featured database classes

5) What are hooks in CodeIgniter?

In CodeIgniter, hooks provide a way to change inner working of the framework without hacking the core files. It helps to execute a script with a specific path within the CodeIgnite. It is defined in application/config/hooks.php file.

6) What are the types of hook in CodeIgniter?

There are various types of hook in CodeIgnite like:
  • post_controller_constructor
  • pre_controller
  • pre_sytem
  • post_sytem
  • cache_override
  • display_override
  • post_controller

7) How can we load or add a model in CodeIgniter?

In CodeIgniter, we can load or add a model using following functions:
$this->load->model ('Model_Name');

8) What is inhibitor in CodeIgniter?

In CodeIgniter, Inhibitor is an error handler class, that uses following functions to handle parse errors, exceptions, and fatal errors. like:
  • set_exception_handler,
  • set_error_handler,
  • register_shutdown_function

9) What are the features of CodeIgniter?

CodeIgniter features are:
  • It is an open source framework.
  • It is extremely light weighted.
  • It is based on Model View Controller (MVC) pattern.
  • It has full featured database classes and support for several platforms.
  • It is extensible. We can extend system by using own libraries.
  • It has excellent documentation.

10) What are the security parameters for XSS in CodeIgniter?

In CodeIgniter, it provides a cross-site scripting hack prevention filter. This filter either runs automatically or we can run it as per requirement, for filter all POST and COOKIE data. The XSS used filter methods to trigger JavaScript or other types of code that attempt to hijack cookies or other malicious activity. If it detects any suspicious thing or anything disallowed is encountered, it will convert the data to character entities.

11) What is MVC in CodeIgniter?

In CodeIgniter, MVC is design pattern that provides a separate logical view from the presentation view. MVC contains minimal scripting while web page is created.

12) How can we access config variable in CodeIgniter?

In CodeIgniter, we can access config variable by using the following command:
$this->config->item('variable name');

13) How can we unset session in CodeIgniter?

In CodeIgniter, we can unset session using given command:
$this->session->unsetuserdata('somename');;

14) Can I extend the core database class in CodeIgniter?

No, CodeIgniter doesn't allow to extend core database classes.

15) How can we enable CSRF (Cross Site Request Forgery) in CodeIgniter?

We can enable CSRF (Cross Site Request Forgery) in CodeIgniter by setting configuration in the following file: application/config/config.php file and setting it to
$config [ 'csrf_protection'] = TRUE;

16) How can we create a library in CodeIgniter?

In CodeIgniter, there are some techniques to create a library,
  • Creating an entire new library
  • Extending native libraries
  • Replacing native libraries

17) How can we connect multiple databases in CodeIgniter?

In CodeIgniter, we can connect multiple databases using following command:
$db1 = $this->load->database('group_one', TRUE);  

$db2 = $this->load->database('group_two', TRUE);

18) How can we create link image/css/javascript from a view in CodeIgniter?

We can create link image/css/javascript by using following code:
  • /css/styles.css
  • /js/query.php
  • /img/news/566.gpg

19) What is inhibitor in CodeIgniter?

In CodeIgniter, inhibitor is an error handler class. Example: set_exception_handler, set_error_handler etc.

20) In which language CodeIgniter is written?

PHP

21) How can you print SQL statement in CodeIgniter model?

The following code is used to print SQL statement:
  1. $this>db>insertid();

22) How can we get random records in mysql using codeIgniter?

In CodeIgniter, we can get random records in mysql by using given code:

23) Can we extend the core Database class?

No, we cannot extend the core Database class.

24) What the difference is between require and include?

Both is used to include a file but when include file not found .

25) What is the difference between Component, Helper, Behavior?

Component is a Controller extension, Helpers are View extensions, Behavior is a Model Extension.

26) What are CodeIgniter security methods?

There are various CodeIgniter security methods:
  • XSS filtering
  • CSRF (Cross-site Request Forgery)
  • Class reference

27) How to create a driver in CodeIgniter?

In CodeIgniter, the following steps to create a driver:
  • Making file structure
  • Making driver list
  • Making driver(s)

28) How can we load multiple helper files?

The following code is used to load multiple helper files:
$this->load->helper(    

array('helper1', 'helper2', 'helper3')    

);

29) What is helper?

Helper is a group of functions. The given following helpers are: URL Helpers: It is used help to create links. Text Helpers: It is used to perform various text formatting routines. Cookies Helpers: It is used to set and read cookies.

30) How can we extend class in CodeIgniter?

We can extend class in CodeIgniter create a file name application/core/MY_Input.php and declare the class with Class MY_Input extends CI_Input {}.