×

Top 30 CodeIgniter interview Questions for 2024

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 {}.

Related Topics

Top 15 Java Collections Interview Questions for 2024

1) What is Collections in Java? It is a framework which is used to store and manipulate the group of objects. 2) What are the commonly used methods of Collection interface in...

2 minutes read.

Top 15 Java BeanUtils Interview Questions for 2024

1) What is Java BeanUtils? Java BeanUtils is a design pattern component of the Apache Commons. It facilitates architecture for Java language which is derived from JavaAPI. It helps to set...

3 minutes read.

Top 16 Groovy interview Questions for 2024

1) What is Groovy? Groovy is an object oriented programming language. It is based on java platform. It can also be used as scripting language. 2) Who designed the Groovy? James Strachan designed...

2 minutes read.

Top 31 Dart Programming Interview Questions for 2024

1) What is Dart? Dart is an application programming language. It is used to build web, server and mobile applications. 2) Who is the developer of Dart? Google is the developer of Dart. 3)...

6 minutes read.

Top 28 Firebase Interview Questions for 2024

1) What is Firebase? Firebase is a platform which is used for building Web, IOS and Android applications. It offers: Real time database Different APIs Multiple authentication types and Hosting platform 2) What are the features of...

3 minutes read.

Top 15 Java JDBC Interview Questions for 2024

1) What are the types of JDBC Drivers in Java? JDBC Drivers are of four types are: JDBC-ODBC bridge driver Native-API driver Network Protocol driver Thin driver 2) What are the five...

4 minutes read.

Top 12 Docker Interview Questions for 2024

Most frequently asked Docker Interview Questions and Answers for Fresher 1. What is Docker? Docker is a new form of Software Containerization in the field of IT. It is an open-source container...

4 minutes read.

Top 15 Ext Js Interview Question for 2024

1) What is Ext Js? Ext Js refers to Extended JavaScript. Ext JS is a JavaScript framework used to built interactive cross platform web application. 2) What are the features of Ext...

3 minutes read.

Top 30 JSF Interview Questions for 2024

1) What is JSF? JSF stands for Java Server Faces is a Java-Based web application framework. JSF (Java Server Faces) provides a facility to connect UI widgets with data sources. 2) What are...

4 minutes read.

Top 30 Go Programming Language Interview Questions for 2024

1) What is Go Programming language? Go programming language is an open source programming language. It is developed at Google in 2007. It is designed for system programming language. 2) Who designed...

4 minutes read.

Top 15 NodeJS Interview Questions for 2024

1) What is NodeJs? NodeJs is open source JavaScript based feamework used to develop I/O intensive web application. It is collections of JavaScript library and runtime environment. It is used to...

3 minutes read.

Top 30 VB Script Interview Questions for 2024

1) What is VB Script? VBScript stands for Visual Basic Scripting Language. It is a light version of Microsoft Visual Basic. It is a client side scripting Language. 2) What is the...

5 minutes read.

Top 15 RESTful Web Services Interview Question for 2024

1) What is REST? REST is web standards based architecture and stands for REpresentational State Transfer. It uses HTTP Protocol for data communication. Here, everything is a resource. 2) What are the HTTP methods used...

2 minutes read.

Top 15 XHTML Interview Questions for 202

1) What is XHTML? XHTML (Extensible Hyper Text Markup Language) it is similar to the HTML but has some strict rule than HTML. It is said to be HTML defined as...

3 minutes read.

Top 30 D Programming Language Interview Questions for 2024

1) What is D programming language? D programming language is an object oriented programming language. It is created by Walter Bright of Digital Mars. It was released in 2001. 2) Who is the...

4 minutes read.

Top 25 CoffeeScript Interview Questions for 2024

1) What is CoffeeScript? It is a language that compiles into JavaScript. CoffeeScript is an attempt to expose good parts of JavaScript so, that user can code more easily. 2) Name the...

3 minutes read.

Top 15 Euphoria Interview Questions for 2024

1) What is Euphoria? Euphoria is a programming language. It is open source, powerful and easy to learn. It stands for End-User Programming with Hierarchical Objects for Robust Interpreted Applications 2) Who...

2 minutes read.

Top 15 Struts Interview Questions for 2024

1) What are the Features of Struts 2? Features of Struts 2 are: Configurable MVC components POJO based actions AJAX support Integration support Various Result Types Various Tag support Theme and...

3 minutes read.

Top 13 SAS Interview Questions for 2024

1. What is SAS and its functions? SAS (Statistical Analysis System) is statistical software designed by SAS Institute in 1960 for data inspection and report writing. SAS runs on Windows, UNIX...

5 minutes read.

Top 31 PHP Interview Questions for 2024

1) What is PHP? PHP is a object-oriented scripting language, open source, interpreted and executed at server side. It is also used to develop web applications. 2) What are the features of PHP? Features...

4 minutes read.