{"id":11176,"date":"2021-08-23T17:15:27","date_gmt":"2021-08-23T17:15:27","guid":{"rendered":"https:\/\/www.monsterindia.com\/career-advice\/codeigniter-interview-questions-and-answers-11176\/"},"modified":"2023-03-23T18:11:01","modified_gmt":"2023-03-23T12:41:01","slug":"codeigniter-interview-questions-and-answers","status":"publish","type":"post","link":"https:\/\/www.foundit.com.ph\/career-advice\/codeigniter-interview-questions-and-answers\/","title":{"rendered":"Top 40 CodeIgniter Interview Questions and Answers"},"content":{"rendered":"\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><a href=\"https:\/\/www.monsterindia.com\/search\/codeigniter-jobs\">CodeIgniter<\/a> is a powerful PHP-based <a href=\"https:\/\/www.monsterindia.com\/search\/web-developer-jobs\">web development<\/a> framework that was created by EllisLab in 2006. Though in 2014 it entered into a stewardship of British Columbia Institute of Technology, this was taken up by CodeIgniter Foundation in 2019.<\/span><\/p>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\">CodeIgniter Open Source<span style=\"font-weight: 400;\"> is a PHP MODEL VIEW CONTROLLER (MVC) framework that is helpful for developers who want a simple and decent toolkit to create full-fledged web applications. It provides libraries to connect to the database and perform multiple functions like session management, sending emails, and file uploads.<\/span><\/span><\/p>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><span style=\"font-weight: 400;\">Working with CodeIgniter requires <a href=\"https:\/\/www.monsterindia.com\/search\/php-developer-jobs\">PHP experience<\/a> since it is built on PHP\u2019s framework. With Web Development prospects on rise, the need for skilled Codeigniter engineers are more than they have ever been. The following <\/span>CodeIgniter Interview Questions<span style=\"font-weight: 400;\"> are aimed to help a candidate preparing for these job positions to build a solid base and also give them a fair idea of what they can face.<\/span><\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>First, let\u2019s look at some commonly asked CodeIgniter Interview Questions.<\/strong><\/h2>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><span style=\"font-weight: 400;\">Compare these job interview questions with a competing set of <\/span>Laravel Interview Questions<span style=\"font-weight: 400;\"> to get a comprehensive idea of open-source, PHP based, fast-development frameworks. Conceptual <\/span>CodeIgniter Interview Questions<span style=\"font-weight: 400;\"> often act as deciding factors for recruiters while choosing individuals for their web development\/Codeigniter positions.<\/span><\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q1.<\/strong> <strong>HOW DO WE DEFINE CODEIGNITER?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong><span style=\"font-weight: 400;\"> CodeIgniter is an open-source PHP framework responsible for the development of web applications. This framework is based on MVC Architectural design.&nbsp;<\/span><\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q2. LIST SOME FEATURES OF CODEIGNITER?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\">CodeIgniter Interview Questions <span style=\"font-weight: 400;\">like these require simple and to the point answers with one or two liners describing each point. It is recommended not to over-explain a single point or give no explanation at all. Precision and shorter descriptions comprise a winning formula.<\/span><\/span><\/p>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong><span style=\"font-weight: 400;\"> Following are some features of CodeIgniter:<\/span><\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li style=\"font-weight: 400;\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>OPEN-SOURCE: <\/strong><span style=\"font-weight: 400;\">Codeigniter is open-source and is backed by Open Software License (OSL).<\/span><\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>SMALL FOOTPRINT FRAMEWORK:<\/strong><span style=\"font-weight: 400;\"> The entire source code for the CodeIgniter framework is only around 2MB.<\/span><\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>BLAZING FAST<\/strong><span style=\"font-weight: 400;\">: CodeIgniter takes only seconds to load right after installation.<\/span><\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>CLEAR DOCUMENTATION<\/strong><span style=\"font-weight: 400;\">: The framework is well-documented with apt books, in-depth tutorials, and forum questions with proper answers on CodeIgniter. This means that regardless of the problems the user is facing, someone might have found the problem and solved it, and there is already a solution.<\/span><\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>APPLICATION SPECIFIC COMPONENTS THAT ARE BUILT-IN<\/strong><span style=\"font-weight: 400;\">: It has components for giving emails, management of databases, management of sessions, etc. Built-in functions are designed to operate independently without over-reliance on other components, making maintenance easier.<\/span><\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>SIMPLE SOLUTIONS<\/strong><span style=\"font-weight: 400;\">: It encourages MVC but doesn\u2019t force it on the user.<\/span><\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>STRONG SECURITY<\/strong><span style=\"font-weight: 400;\">: CodeIgniter protects against Cross-Site Request Forgery and XSS (cross-site scripting) attacks.<\/span><\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>EXTENDABLE<\/strong><span style=\"font-weight: 400;\">: Users can easily extend the system by using Libraries, Helpers.<\/span><\/span><\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q3.<\/strong> <strong>WHICH IS THE NEWEST VARIANT OF CODEIGNITER?<\/strong><span style=\"font-weight: 400;\">&nbsp;<\/span><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong><span style=\"font-weight: 400;\"> 4.1.3 is the edition of the CodeIgniter framework. This version was released on June 6th, 2021. This is probably among the most common <\/span>CodeIgniter Interview Questions<span style=\"font-weight: 400;\"> and applicants are advised to be abreast of the latest releases to be able to successfully answer this.<\/span><\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q4.<\/strong> <strong>WHICH IS THE STABLE VERSION OF CODEIGNITER?<\/strong><span style=\"font-weight: 400;\">&nbsp;<\/span><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong><span style=\"font-weight: 400;\"> 4.1.1 is the stable version and it was released on February 1st, 2021.<\/span><\/span><\/p>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\">Codeigniter Interview Questions<span style=\"font-weight: 400;\"> like these should be dealt with caution. It is common to mix up between the latest release and the latest \u2018stable\u2019 release.<\/span><\/span><\/p>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><span style=\"font-weight: 400;\">Next, we look at <\/span>CodeIgniter Interview Questions<span style=\"font-weight: 400;\"> that focus on the architecture of CodeIgniter and go into detail about the entire MVC framework.<\/span><\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q5. EXPLAIN CODEIGNITER ARCHITECTURE.<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong><span style=\"font-weight: 400;\"> When a request comes from the CodeIgniter application, it will first go to the index .php page to routing to decide whether the request passes through cache or a security check. If the requested page doesn\u2019t exist in the cache file, then routing will pass the request to security check. After testing the security check, the registered page will go to the application controller. The application controller is used to load the files like libraries, Models, Helpers, Plugins, and Scripts and then pass them to the View. A view is used to fetch the data from the application controller that will be presented to the user.<\/span><\/span><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"http:\/\/media.monsterindia.com\/cmsimages\/1629718911.PNG\" alt=\"\"\/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q6. HOW DO YOU CHECK THE VERSION OF CODEIGNITER YOU ARE USING?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong><span style=\"font-weight: 400;\"> Users can check the version of CodeIgniter by two methods:<\/span><\/span><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li style=\"font-weight: 400;\"><!--?php echo C1_VERSION;?--><!--?php echo C1_VERSION;?--><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">By navigating to the system \/core\/CodeIgniter.php directory and run the following code:<\/span><\/li><\/ol>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>define(\u2018CI_VERSION\u2019,\u20192.1.4\u2019);<\/strong><\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q7. WHICH DATABASES CAN BE USED IN CODEIGNITER?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong><span style=\"font-weight: 400;\">&nbsp; Commonly asked <\/span><strong>CodeIgniter Interview Questions <\/strong><span style=\"font-weight: 400;\">will feature this topic- Following are the most common databases that can be used with CodeIgniter:-<\/span><\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">MySQL<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">ORACLE<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">SQLite<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">ODBC<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">FIREBIRD<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">CUBERID etc.<\/span><\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q8. EXPLAIN THE MVC STRUCTURE OF CODEIGNITER.<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong><span style=\"font-weight: 400;\"> MVC stands for MODEL VIEW CONTROLLER. Model View Controller separates application logic from the presentation layer. It helps web pages to contain minimum scripting.<\/span><\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li style=\"font-weight: 400;\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>MODEL:<\/strong><span style=\"font-weight: 400;\"> It is used to represent <a href=\"https:\/\/www.monsterindia.com\/search\/data-structures-jobs\">data structures<\/a>. Model classes constitute functions that help to insert, retrieve, and update information in the database.<\/span><\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>CONTROLLER:<\/strong><span style=\"font-weight: 400;\"> It acts as an intermediary between the view, model, or any other resource to process HTTP requests. The Controller controls the whole application by URI.<\/span><\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>VIEW:<\/strong><span style=\"font-weight: 400;\"> It represents the information that is being presented to the user. In CodeIgniter, a View could be a simple or complex webpage. The web page contains a header, footer, sidebar, etc. A view cannot be called directly.<\/span><\/span><\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"http:\/\/media.monsterindia.com\/cmsimages\/1629719035.PNG\" alt=\"\"\/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><span style=\"font-weight: 400;\">Next set of <\/span><strong>CodeIgniter Interview Questions<\/strong><span style=\"font-weight: 400;\"> delve into the concept of a model, its uses and other related concepts.<\/span><\/span><\/p>\n\n\n\n<p>\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q9. EXPLAIN THE BASIC STRUCTURE OF A MODEL?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans<\/strong><span style=\"font-weight: 400;\">. Models are PHP classes that are designed to work with information in the database. Model classes are stored in application\/models\/directory.<\/span><\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">The Basic Prototype for a model class is:<\/span><\/p>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><span style=\"font-weight: 400;\">&nbsp;&nbsp;<\/span><strong>class Model_Name extends CI_Model  <\/strong><\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">Here Model_ Name implies to Name of Class.<\/span><\/p>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>NOTE:<\/strong><span style=\"font-weight: 400;\">&nbsp;<\/span><\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">The first Letter of the class name must start with an upper-case letter with the rest of the name lowercase.<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">Make Sure the class extends the base Model Class.<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">The File Name must match the class name.<\/span><\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q10 HOW DO YOU LOAD A MODEL IN CODEIGNITER?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans<\/strong><span style=\"font-weight: 400;\">. Models can be loaded and called from within the controller methods.<\/span><\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">The following method is used to load a model:<\/span><\/p>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>&nbsp;<\/strong> <strong>$this-&gt; load -&gt;model -&gt;(&#8216;model_name&#8217;);<\/strong><\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">If the model is in a sub-directory, replace &#8216;model_ name&#8217; with the path of the sub directory.<\/span><\/p>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Example:<\/strong><span style=\"font-weight: 400;\">&nbsp;<\/span><\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">If your model is in application\/models\/placeholder\/name.php, then you must put &#8216;placeholder\/name&#8217; inside the parenthesis.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q11. HOW TO AUTO-LOAD A MODEL?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong><span style=\"font-weight: 400;\"> If the user needs a particular model globally throughout the application, the user can tell the CodeIgniter to autoload it during system initialization.<\/span><\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">This can be done by opening the application\/config\/autoload.php file and adding the model to the autoload array.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q12. HOW WOULD YOU CONNECT MODELS TO A DATABASE AUTOMATICALLY?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong> <strong>CodeIgniter Interview Questions <\/strong><span style=\"font-weight: 400;\">will have this listed as an important query. Loading a model doesn&#8217;t connect to the database automatically. There are different methods to connect a database:-<\/span><\/span><\/p>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Auto Connect:<\/strong><span style=\"font-weight: 400;\"> This feature automatically loads the database with every page load. To enable auto-connect, go to application\/config\/autoload.php and add word database to library array.<\/span><\/span><\/p>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Manually Connecting Database<\/strong><span style=\"font-weight: 400;\">: If the user wants to connect the database only to some pages of the project, the user can use the following code:<\/span><\/span><\/p>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>$this-&gt;load-&gt;database ();<\/strong><\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q13. HOW TO LOAD A VIEW IN CODEIGNITER?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans<\/strong><span style=\"font-weight: 400;\">. A View cannot be loaded directly. It must be called by a controller. A View can be loaded using the following code:&nbsp;<\/span><\/span><\/p>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><span style=\"font-weight: 400;\">&nbsp;<\/span> <strong>$this-&gt;load-&gt;View(&#8216;name&#8217;)<\/strong><\/span><\/p>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>NOTE:&nbsp;<\/strong><\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">The page name should be written in brackets.<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">Don&#8217;t specify .php unless you are using some other extension.<\/span><\/li><\/ul>\n\n\n\n<p>\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q14 WHAT IS A CONTROLLER IN CODEIGNITER?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans<\/strong><span style=\"font-weight: 400;\">. A Controller acts as an intermediary between the model and the view to process the HTTP request. Controllers receive input from the user and determine what to do with the input- whether passing the data to a model to save or requesting the data from the model which is passed on to the view to be displayed. The name of the controller class file is directly associated with the URL. The name of the controller class must start with an uppercase letter. The controller must be called with a lowercase letter.<\/span><\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q15. WHY CODEIGNITER IS CALLED AS LOOSELY BASED MVC FRAMEWORK?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong><span style=\"font-weight: 400;\"> CodeIgniter is called a loosely based framework because in this, the controller is the necessary element, but Model and Views are not mandatory. In other words, users can build a website without a Model. Moreover, users can modify CodeIgniter to utilize HMVC as well.<\/span><\/span><\/p>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><span style=\"font-weight: 400;\">Libraries and Helpers are important concepts an interested applicant should be aware of. This is reflected in the <\/span>CodeIgniter Interview Questions<span style=\"font-weight: 400;\"> based on these two keywords alone and their different uses in the overall framework. <\/span>Job Interview Questions<span style=\"font-weight: 400;\"> like these on <\/span>CodeIgniter Open Source <span style=\"font-weight: 400;\">framework should be part of preparatory steps while applying for these Web Development positions.<\/span><\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>CodeIgniter Interview Questions on Helpers:<\/strong><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q16. EXPLAIN HELPERS IN CODEIGNITER?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong><span style=\"font-weight: 400;\"> Helpers help the user to accomplish the task. These are basically a collection of simple and substantive functions. Each performs one specific job. Helpers are independent of each other and they are not written in object-oriented format. Once live, it becomes universally available in the controller section and view section. This is a useful tool asked during <\/span>CodeIgniter Interview Questions.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q17. EXPLAIN DIFFERENT TYPES OF HELPERS?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong><span style=\"font-weight: 400;\"> Different types of helpers are as follows:<\/span><\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li style=\"font-weight: 400;\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>FILE HELPER<\/strong><span style=\"font-weight: 400;\">: It helps to deal with the file.<\/span><\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>TEXT HELPER:<\/strong><span style=\"font-weight: 400;\"> This is used to perform various text formatting routines.<\/span><\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>FORM HELPER:<\/strong><span style=\"font-weight: 400;\"> It helps in creating form elements.<\/span><\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>COOKIE HELPER:<\/strong><span style=\"font-weight: 400;\"> set and real cookies&nbsp;<\/span><\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>URL HELPER:<\/strong><span style=\"font-weight: 400;\"> It assists in creating links.<\/span><\/span><\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q18. HOW DO YOU LOAD A HELPER FILE ALSO EXPLAIN HOW TO LOAD MULTIPLE HELPER FILES?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong><\/span><\/p>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>$this-&gt;load-&gt;helper(&#8216;file_name&#8217;);<\/strong><\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">Where file_ name is the file name of the helper.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">To load URL Helper, use<\/span><\/p>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>$this-&gt;load-&gt;helper(&#8216;url&#8217;);<\/strong><\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">A Helper can be inserted anywhere.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">If the user wants to load multiple helpers, then the user needs to specify them in an array. This can be done by using the following method:<\/span><\/p>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>$this -&gt;load-&gt;helper(array(&#8216;Helper1&#8242;,&#8217;Helper2&#8242;,&#8217;Helper3&#8217;));<\/strong><\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">Here Helper 1,2,3 represents different helper\u2019s names.<\/span><\/p>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>CodeIgniter Interview Questions on Libraries:<\/strong><\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q19. WHAT IS A LIBRARY IN CODEIGNITER?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong><span style=\"font-weight: 400;\"> Libraries are packages that provide high-level abstractions. CodeIgniter provides a rich set of libraries. Libraries increase the speed of an application. The library is located in the System\/Library.<\/span><\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q20. HOW DO YOU LOAD A LIBRARY IN CODEIGNITER?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong><span style=\"font-weight: 400;\"> Libraries can be loaded by using below code:<\/span><\/span><\/p>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>$this-&gt;load-&gt;library(&#8216;Class_Name&#8217;);<\/strong><\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">Where Class_Name represents the name of the library.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">Multiple Libraries can also be loaded by using following code:<\/span><\/p>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>$this-&gt;load-&gt;library-&gt;(array(&#8216;library1&#8242;,&#8217;library2&#8217;));<\/strong><\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q21. HOW DO YOU CREATE A LIBRARY IN CODEIGNITER?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong><span style=\"font-weight: 400;\"> CodeIgniter Libraries are stored in the System folder. Users can also create a new library inside the application\/Libraries folder by coding. This is done to separate local and global framework resources.<\/span><\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">Libraries can be created by using 3 methods:<\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">Creating an entirely new library.<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">Extending Native Library.<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">Replacing Native Library.<\/span><\/li><\/ul>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>NOTE:<\/strong><\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">Capitalize the first letter of all file names.<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">Class name first letter must be an uppercase letter.<\/span><\/li><\/ul>\n\n\n\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">The file name and class name should be the same.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q22. DIFFERENTIATE BETWEEN LIBRARY AND HELPER?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong> <strong>LIBRARY&nbsp;<\/strong><\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">The Library is a class. So, the user needs to make an instance of the class to use it.<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">Libraries are located under System\/Libraries.<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">It is object-oriented.<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">A library can be loaded using $this-&gt;load-&gt;library (&#8216;library name&#8217;).<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">To call library functions, the user needs to create an object of the class.<\/span><\/li><\/ul>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>HELPERS&nbsp;<\/strong><\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">A Helper is a file that has PHP functions.<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">Helpers are located under System\/Helpers.<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">These are not written in an object-oriented format, hence the user can simply call helper functions.<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">A Helper can be loaded using $this-&gt;load-&gt;Helper (&#8216;helper name&#8217;)<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">Helpers can be called in the same way you call PHP functions.<\/span><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>CodeIgniter Interview Questions on Hooks:<\/strong><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q23. WHAT ARE HOOKS IN CODEIGNITER?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong><span style=\"font-weight: 400;\"> Hooks allow the user to execute a script with a particular path within the CodeIgniter. It allows you to change the inner working of the framework without changing the core files. Hooks are defined in application\/config\/hooks.php file.<\/span><\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q24. HOW DO YOU ENABLE HOOKS IN CODEIGNITER?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong><span style=\"font-weight: 400;\"> Hooks can be enabled by navigating to the application\/config\/config.php file and switch the following setting to &#8216;TRUE&#8217; as shown below &#8211;<\/span><\/span><\/p>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>$config[&#8216;enable_hooks&#8217;] = TRUE;<\/strong><\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q25. LIST VARIOUS TYPES OF HOOK POINTS IN CODEIGNITER?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong><span style=\"font-weight: 400;\">&nbsp;<\/span><\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li style=\"font-weight: 400;\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>pre_system:<\/strong><span style=\"font-weight: 400;\"> It is called much before the system execution. At this point, only hook class and benchmark must be loaded.<\/span><\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>pre_controller:<\/strong><span style=\"font-weight: 400;\"> It is called immediately before any of the controllers being called. At this point, all the classes, security checks, and routing must be done&nbsp;<\/span><\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>post_controller:<\/strong><span style=\"font-weight: 400;\"> As the name suggests, it is called immediately after the controller is completely executed.<\/span><\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>post_controller_constructor:<\/strong><span style=\"font-weight: 400;\"> This is called after your controller is instantiated but before any method calls happen.<\/span><\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>cache_override:<\/strong><span style=\"font-weight: 400;\"> It allows the user to call functions in the output class.<\/span><\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>display_override:<\/strong><span style=\"font-weight: 400;\"> It is used to send the final page at the end of the final execution.<\/span><\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>post_system:<\/strong><span style=\"font-weight: 400;\"> It is called after the final page is sent to the browser at the end of the system execution.<\/span><\/span><\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q26. HOW CAN WE CONFIGURE HOOKS IN CODEIGNITER?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong><span style=\"font-weight: 400;\"> Hooks can be globally enabled or disabled by setting in the&nbsp;<\/span><\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">application\/config\/config.php<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">It can be defined in&nbsp;<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">application\/config\/hooks.php page<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>CodeIgniter Interview Questions on Security, SQLs and other concepts:<\/strong><\/span><\/h2>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\">Job interview questions<span style=\"font-weight: 400;\"> on these topics are very important in today\u2019s day and age. Security, especially about cross-site scripting &#8211; the most common vulnerability in the web apps today, is sought after in most CodeIgniter Web Developer\/Engineers by organizations, and it is imperative to include these in the preparatory stack of <\/span>CodeIgniter Interview Questions<span style=\"font-weight: 400;\">.<\/span><\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q27. WHAT IS AN INHIBITOR?&nbsp;<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong><span style=\"font-weight: 400;\"> An Inhibitor is an error handling class in CodeIgniter. Inhibitor uses the native PHP functions to handle parse errors, exceptions, and fatal errors. These native PHP functions are as follows:<\/span><\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">set_exception_handler<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">set_error_handler<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">register_shutdown_function<\/span><\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q28. WHAT ARE DRIVERS IN CODEIGNITER. ALSO, EXPLAIN HOW DO YOU INITIALISE A DRIVER IN CODEIGNITER?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong><span style=\"font-weight: 400;\"> Drivers are special types of the library that has a parent class and multiple child classes. Child Classes can access the parent class but do not have access to a sibling class. Drivers are found in the system\/libraries folder in the CodeIgniter folder.<\/span><\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">&nbsp;To make use of a driver in CodeIgniter, the user must initialize it inside the controller by using the following code:<\/span><\/p>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>$this-&gt;load-&gt;driver(&#8216;Class_Name&#8217;);<\/strong><\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q29 HOW DO YOU CREATE A DRIVER IN CODEIGNITER?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong><span style=\"font-weight: 400;\"> Drivers can be created by using three steps:<\/span><\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">Create a file name such as &#8216;Driver_name.php&#8217;.<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">Create a driver list inside the file.<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">Write the code for each individual driver.<\/span><\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q30. WHAT IS THE BASIC CODEIGNITER URL STRUCTURE?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong><span style=\"font-weight: 400;\"> CodeIgniter uses a segment-based approach. Its URL structure is:<\/span><\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">abc.com\/class\/function\/ID<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">Where class: controller class.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">Function: the method that is called.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">ID: additional segment which is passed to the controller.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q31. WHY DO URL ROUTES NEED TO BE CONFIGURED?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong><span style=\"font-weight: 400;\"> URL Routes needs to be configured because of the following reasons:<\/span><\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">To improve the number of page visits.<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">To hide the code complexities from the user.<\/span><\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q32. WHAT ARE CODEIGNITER SECURITY METHODS?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong><span style=\"font-weight: 400;\"> CodeIgniter Security methods help in creating a secure application. It has several ways of implementing security in the web application and protecting the raw input data fed to your program. Following are the CodeIgniter security methods:<\/span><\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">XSS filtering (Cross-Site Scripting)<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">CSRF (Cross-Site Request Forgery)<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">Class-Reference.<\/span><\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q33. EXPLAIN HOW CSRF CAN BE ENABLED (CROSS-SITE REQUEST FORGERY) IN CODEIGNITER?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong><span style=\"font-weight: 400;\"> CSRF can be activated by operating&nbsp;<\/span><\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">application\/config\/config.php file and setting it to<\/span><\/p>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$ config [&#8216;csrf_protection&#8217;] = TRUE;<\/strong><\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q34. HOW DO YOU PRINT A SQL STATEMENT IN CODEIGNITER MODEL?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong><span style=\"font-weight: 400;\"> Users can print a SQL statement by using the following code:<\/span><\/span><\/p>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>$this&gt;db&gt;insertid();<\/strong><\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q35. HOW DO YOU CALL A CONSTRUCTOR IN CODEIGNITER?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong><span style=\"font-weight: 400;\"> A Constructor can be called by using the following syntax:<\/span><\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">&nbsp;&nbsp;parent:___construct();<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q36. DESCRIBE ORM? LIST SOME ORM\u2019s FOR CODEIGNITER?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans. <\/strong><span style=\"font-weight: 400;\">It stands for Object Relational Mapping. It is a programming technique for converting data between incompatible type systems using OOPs (Object-Oriented Programming Language). <\/span><strong>CodeIgniter Interview Questions <\/strong><span style=\"font-weight: 400;\">will determine your knowledge on this topic.<\/span><\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">Following are the ORM\u2019s supported by CodeIgniter:<\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li style=\"font-weight: 400;\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Data Mapper<\/strong><span style=\"font-weight: 400;\">: It is an object relational mapper which is written in PHP for CodeIgniter. It is curated to transform database tables into easy-to-use objects that are fully aware of the relationships between them.<\/span><\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Doctrine<\/strong><span style=\"font-weight: 400;\">: It contains tutorials, a reference section, and cookbook articles that help to explain the different parts of the object-relational mapper.<\/span><\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Gas ORM<\/strong><span style=\"font-weight: 400;\">: Gas ORM is easy to use and a lightweight object-relational Mapper for the CodeIgniter. This was specifically built for the CodeIgniter app. It uses CodeIgniter database packages, a powerful DBAL that supports multiple database drivers.&nbsp;<\/span><\/span><\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q37. EXPLAIN XSS FILTERING IN CODEIGNITER?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong><span style=\"font-weight: 400;\"> XSS, also known as Cross-Site Scripting &#8211; is used to disable those codes which try to hijack cookies and perform other malicious activities.<\/span><\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">XSS filtering converts data to character entities if it encounters anything harmful. It uses the xss_clean() method to filter data.<\/span><\/p>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><span style=\"font-weight: 400;\">&nbsp;<\/span> <strong>$data= $this-&gt;xss_clean($data);<\/strong><\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">This filtering is also used to test images for XSS attacks. When this parameter is set to TRUE, it will not return an altered string. It returns TRUE if the image is safe and FALSE if it contains malicious information.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q38. EXPLAIN HOW CODEIGNITER CAN BE PREVENTED FROM CSRF ATTACKS (CROSS-SITE REQUEST FORGERY)?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong><span style=\"font-weight: 400;\"> There are multiple methods to protect CodeIgniter from CSRF attacks. But one of the most effective methods is to use Anti-CSRF Tokens. In this method, users can use a hidden field in each form on the website. This is known as CSRF Tokens. CSRF token is a random value that changes with each HTTP request sent. When it is inserted into the website forms, it gets saved in the user\u2019s session as well. So, when the form is submitted by the user, the website confirms whether it is the same as the one saved in the session. If it matches, then the request is legitimate. The token value changes each time the page is loaded, which makes it tough for the hackers to guess the current token.<\/span><\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q39. EXPLAIN WHAT A CSRF ATTACK IS AND HOW IT CAN BE ENABLED IN CODEIGNITER?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong><span style=\"font-weight: 400;\"> CSRF (CROSS-SITE REQUEST FORGERY) is an attack that forces an unauthenticated user to execute unwanted actions on a web application. This CSRF attack is very common attack. It is considered a sleeping giant in the web application world.<\/span><\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">User can activate CSRF protection in CodeIgniter by operating application\/config\/config.php file and setting it to&nbsp;<\/span><\/p>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><span style=\"font-weight: 400;\">&nbsp;&nbsp;&nbsp;&nbsp;<\/span> <strong>$config[&#8216;csrf_protection&#8217;] = TRUE;<\/strong><\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">If the user wants to make use of the form helper, the form_open() function will insert a hidden CSRF field in your forms automatically.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Q40. EXPLAIN HOW IMAGES\/CSS\/JAVASCRIPT CAN BE LINKED FROM A VIEW IN CODEIGNITER?<\/strong><\/span><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif; font-size: 12pt;\"><strong>Ans.<\/strong><span style=\"font-weight: 400;\"> In CodeIgniter, Images\/CSS\/JavaScript can be linked from a View by using an absolute path. It is as follows:<\/span><\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">\/css\/styles.css<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">\/js\/query.php<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif; font-size: 12pt;\">\/img\/news\/566.jpg<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>CONCLUSION\u00a0<\/strong><\/h2>\n\n\n\n<p><span style=\"font-size: 12pt; font-family: verdana, geneva, sans-serif;\">In conclusion, the set of CodeIgniter Interview Questions presented here summarize the type of queries that aspiring web developers can face in their job seeking conquest. To have a solid PHP and web development foundation is key; Combining these job interview questions with the right kind of knowledge, and added insight in one\u2019s repertoire, e.g. with Laravel interview questions &#8211; would result in an increased propensity to land a job in this world of heavy competition.<\/span><\/p>\n\n\n\n<p><span style=\"font-size: 12pt; font-family: verdana, geneva, sans-serif;\"><strong>More Resources<\/strong> : <a title=\"Freelancer jobs in Delhi\" href=\"https:\/\/www.monsterindia.com\/search\/freelance-jobs-in-delhi\" target=\"_blank\" rel=\"noopener\">Freelancer jobs in Delhi<\/a>&nbsp;| <a title=\"Freelance data entry jobs\" href=\"https:\/\/www.monsterindia.com\/search\/freelance-data-entry-jobs\" target=\"_blank\" rel=\"noopener\">Freelance data entry jobs<\/a>&nbsp;| <a title=\"Personal Interview Questions and Answers\" href=\"https:\/\/www.monsterindia.com\/career-advice\/personal-interview-questions-and-answers\/\" target=\"_blank\" rel=\"noopener\">Personal Interview Questions and Answers<\/a>&nbsp;| <a title=\"Spring Interview Questions and Answers&nbsp;\" href=\"https:\/\/www.monsterindia.com\/career-advice\/spring-interview-questions-and-answers\/\" target=\"_blank\" rel=\"noopener\">Spring Interview Questions and Answers&nbsp;<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>CodeIgniter is a powerful PHP-based web development framework that was created by EllisLab in 2006. Though in 2014 it entered into a stewardship of British Columbia Institute of Technology, this was taken up by CodeIgniter Foundation in 2019. CodeIgniter Open Source is a PHP MODEL VIEW CONTROLLER (MVC) framework that is helpful for developers who [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":11266,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[147],"tags":[],"class_list":{"0":"post-11176","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-interview-questions"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.foundit.com.ph\/career-advice\/wp-json\/wp\/v2\/posts\/11176","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.foundit.com.ph\/career-advice\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.foundit.com.ph\/career-advice\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.foundit.com.ph\/career-advice\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.foundit.com.ph\/career-advice\/wp-json\/wp\/v2\/comments?post=11176"}],"version-history":[{"count":4,"href":"https:\/\/www.foundit.com.ph\/career-advice\/wp-json\/wp\/v2\/posts\/11176\/revisions"}],"predecessor-version":[{"id":15904,"href":"https:\/\/www.foundit.com.ph\/career-advice\/wp-json\/wp\/v2\/posts\/11176\/revisions\/15904"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.foundit.com.ph\/career-advice\/wp-json\/wp\/v2\/media\/11266"}],"wp:attachment":[{"href":"https:\/\/www.foundit.com.ph\/career-advice\/wp-json\/wp\/v2\/media?parent=11176"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.foundit.com.ph\/career-advice\/wp-json\/wp\/v2\/categories?post=11176"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.foundit.com.ph\/career-advice\/wp-json\/wp\/v2\/tags?post=11176"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}