×

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 31 Koa Interview Questions for 2024

1) What is Koa? Koa is a very small framework which provides us a minimal interface to build our applications. It is quite flexible and there are numerous modules available on...

4 minutes read.

Top 30 Cassandra Interview Questions for 2024

1) Explain. What is Cassandra? Cassandra is an open source data storage system. It was developed at Facebook for inbox search and designed for storing and managing large amount of data. 2)...

5 minutes read.

Top 30 SQL Interview Questions for 2024

1. What is SQL? Ans. SQL stands for Structured Query Language.  It is a standard computer language for accessing, storing, and manipulating data stored in the relational database. SQL become an International Standard Organization (ISO)...

11 minutes read.

Top 48 C# Interview Questions for 2024

1) Write a program in C# to print "HELLO WORLD"? class Program         {          static void Main(string  args[])           {             System.Console.WriteLine(" HELLO WORLD ");             }          } 2) Write a program in C# to print "TutorialandExample" using namespace? Here, namespace is used to group related classes. Using System;    namespace  TutorialandExample      {         public class           {             public static void Main(string[]  args)             {              Console.WriteLine(" TutorialandExample ");             }          }       } 3) What are the...

8 minutes read.

Top 15 Erlang Interview Questions for 2024

1) What is Erlang÷ Erlang is an open source programming language. It is used to build massively scalable soft real-time systems. It has runtime environment. It supports concurrency, fault tolerance and...

2 minutes read.

Top 25 Android Interview Questions for 2024

1) What is Android? It is a software package and open-source operating system that is used in mobile devices. It is also a Linux kernel-based system operating system and application executes within...

3 minutes read.

Top 20 HTTP Interview Questions for 2024

1) What is HTTP? HTTP stands for Hypertext Transfer Protocol. It is a set of rules for transferring of data on WWW (World Wide Web). 2) What are the basic Features of...

4 minutes read.

Top 24 Clojure Interview Questions for 2024

1) What is Clojure? Clojure is a dynamic, general-purpose programming language. It is simple, coherent and powerful tool. It is based on Lisp Programming language. 2) Which platform is used to run...

4 minutes read.

Top 10 Java Swing Interview Questions for 2024

1) What is Java Swing? It is a part of JFC (Java Foundation Classess) that is used to create window-based applications. Java Swing components are platform independent and lightweight . 2) What is...

3 minutes read.

Top 30 Less Interview Questions for 2024

1) What is Less? Less is a dynamic style sheet language that can be compiled in to CSS (Cascading style Sheet). It runs on client side and server side. It is...

4 minutes read.

Top 40 IoT Interview Questions and Answers in 2024

Q.1 What is IoT? IoT stands for the Internet of things refers to the interconnection of the network of various devices that can recognize, collect and transfer data over the internet...

13 minutes read.

Top 25 MySQL Interview Questions for 2024

1) What is MySQL? MySql is defined as multi-user DBMS which is built and distributed my MySQLab now acquired by Oracle Co. 2) Enlist the features of MySQL. Cross-Platform Support Wide range...

3 minutes read.

Top 30 Magento Interview Questions for 2024

1) What is Magento? Magento is an open-source content management system. It is used to create e-commerce websites. It is developed by Varien ,Inc, a US private company headquartered in Culver City, California. It...

5 minutes read.

Top 25 DB2 Interview question for 2024

1) Give breif detail about DB2? DB2 is a Relational Database Management System developed by IBM. It supports Object Oriented features and non-relational structures with XML. 2) Enlist the types of datatypes...

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.

A to Z Interview Questions

ABCDEFGHIJKLMNOPQRSTUVWXYZ Interview Questions and Answers List A 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 B Blockchain Interview...

3 minutes read.

Top 50 ReactJS Interview Questions for 2024

Top 50 Frequently asked ReactJS Interview Questions Q-1. What is React? Ans-1 React is a front-end JavaScript library which is developed by Facebook in 2011. It follows the component-based approach and allows us to...

15 minutes read.

Top 28 Scala Interview Questions for 2024

1) What is Scala? Scala is a functional and object-oriented programming language. It is used to develop web application, mobile application, enterprise application, desktop based application etc. Everything in Scala is in object...

4 minutes read.

Top 15 RequireJs Interview Questions for 2024

1) What is RequireJs? RequireJs is a open source JavaScript library which is used to maintain dependencies between JavaScript files and modular programming. 2) What are the features of RequireJs? Following are the...

3 minutes read.

Top 14 Web icon Interview Questions for 2024

1) What is Web Icon? Web Icon is a symbol that is used to represent a specific action or a capability on a webpage. It is used in documents as well...

5 minutes read.