YouTube Icon

Interview Questions.

Codeigniter Interview Questions and Answers for 2 Year Experience - Jul 16, 2022

fluid

Codeigniter Interview Questions and Answers for 2 Year Experience

Q1. What is the Codeigniter?

Ans: Codeigniter is open source, webapplication a PHP framework. Codeigniter is loosely based on MVC sample simple framework in Hypertext Preprocessor.

Q2. When and who advanced Codeigniter?

Ans: The first public version of CodeIgniter become released on February 28, 2006.

Q3. What is the present day model of codeigniter?

Ans: The lastest version 2.2.0 until 6-05-2014.

Q4. Explain Application Flow Chart in codeigniter.

Ans: Application glide chart from Codeigniter documentaion:

The index.Php serves as the the front controller, initializing the base assets had to run CodeIgniter.

The Router examines the HTTP request to decide what must be carried out with it.

If a cache report exists, it's far despatched at once to the browser, bypassing the normal device execution.

Security. Before the utility controller is loaded, the HTTP request and any person submitted records is filtered for protection.

The Controller hundreds the version, core libraries, helpers, and any other resources needed to process the unique request.

The finalized View is rendered then sent to the internet browser to be seen. If caching is enabled, the view is cached first in order that on subsequent requests it could be served.

Q5. Explain how you can amplify the magnificence in Codeigniter?

Ans: To make bigger the native input magnificence in CodeIgniter, you have to construct a file named application/core/MY_Input.Personal home page and declare your class with

Class MY_Input extends CI_Input 

Q6. What are the features of codeigniter?

Ans:

Codeigniter is open source, webapplication framework.

Codeigniter is mild weight framework.

Codeigniter faster than any other farmework.

Codeigniter search engine pleasant urls generator.

Codeigniter is straightforward exensible.

Q7. List out exceptional sorts of hook point in Codeigniter?

Ans: Different sorts of hook point in Codeigniter includes:

post_controller_constructor

pre_controller

post_sytem

pre_system

cache_override

display_override

post_controller

Q8. Explain MVC in Codeigniter.

Ans: Model–View–Controller (MVC) is an architecture that separates the illustration of records from the user’s interaction with it.

Controller: The Controller serves as an intermediary among the Model, the View. Controller mediates input, converting it to instructions for the model or view.

Model: The Model represents your facts systems. Typically your version training will include features that help you retrieve, insert, and update records in your database.The model consists of software statistics and business guidelines.

View: The View is the records this is being supplied to a consumer. A View will normally be an internet page.A view may be any output illustration of statistics.

For more detail information MVC please examine this text What is MVC(Model-View-Controller) Architecture.

Q9. Explain Codeigniter file structure.

Ans:

Application

-cache

-config

-controllers

-core

-errors

-helpers

-hooks

-languages

-logs

-models-

-thirdparty

-view

gadget

-middle

-database

-fonts

-helpers

-language

-libraries

Q10. Explain what is supposed through inhibitor in Codeigniter?

Ans: For CodeIgniter, inhibitor is an mistakes handler class that use local PHP features like set_exception_handler, set_error_handler, register_shutdown_function to address parse mistakes, exceptions, and deadly errors.

Q11. What are the hooks in Codeigniter?

Ans: In CodeIgniter, hooks are occasions which may be referred to as before and after the execution of a program. It permits executing a script with specific course inside the CodeIgniter execution process without enhancing the core documents. For example, it may be used where you need to check whether a user is logged in or no longer before the execution of controller. Using hook will store some time in writing code multiple times.

There are two hook documents in CodeIgniter. One is software/config/hooks.Hypertext Preprocessor folder and other is application /hooks folder.

In different language, if you want to run a code every time after controller constructor is loaded, you can specify that script course in hooks.

He hooks feature can be globally enabled/disabled by placing the subsequent object inside the application/config/config.Php report:

$config[‘enable_hooks’] = TRUE;

Hooks are defined in utility/config/hooks.Hypertext Preprocessor record.For example

$hook['pre_controller'] = array(

'magnificence'    => 'MyClass',

'characteristic' => 'Myfunction',

'filename' => 'Myclass.Personal home page',

'filepath' => 'hooks',

'params'   => array('test', 'test1', 'webs')

);

Q12. Explain what is meant through routing in Codeigniter?

Ans: In CodeIgniter, the manner PHP documents served is in exceptional rather than gaining access to it immediately from the browser. This method is the known as the routing. Routing in CodeIgniter gives you freedom to personalize the default URL pattern to use our personal URL sample in step with the requirement. So, every time there may be a request made and matches our URL sample it is going to be routinely direct to the desired controller and the characteristic.

Q13. How you'll be upload or load an model within the codeigniter?

Ans: Models could be the generally loaded and referred to as from within your controller capabilities. To load a version you will must use the following feature:

$this->load->version('Model_name');

HubSpot Video
 

Q14. Why is there a want to configure the URL routes?

Ans: Changing the URL routes has some advantages like:

From the search engine marketing point of the view, to make URL SEO pleasant and get extra user visits

Hide some URL element which includes the characteristic call, controller name, and so forth. From the users for the security reasons

Provide extraordinary functionality to the particular elements of a system

Q15. Which are the helpers in the Codeigniter?

Ans: Helpers, because the call shows, help you with obligations. Each helper document is without a doubt a group of the capabilities in a specific category.There are URL Helpers, that help in creating hyperlinks, there are Form Helpers that help you create shape factors, Text Helpers carry out diverse text formatting exercises, Cookie Helpers set and read cookies, File Helpers assist you address the documents, etc.

Loading a helper file is quite easy the usage of the subsequent characteristic:

$this->load->helper('name');

Q16. Mention which might be the safety parameter for XSS in the CodeIgniter?

Ans: Codeigniter has got a go-website online scripting hack prevention filter. This filter either runs automatically or you can run it as in step with object foundation, to filter out all of the POST and COOKIE data that come across.  The XSS filter out will goal the usually used methods to trigger JavaScript or different forms of code that attempt to hijack cookies or other malicious pastime. If it detects any suspicious component or some thing disallowed is encountered, it's going to convert the statistics to person entities.

Q17. How can you load the a couple of helper files?

Ans: To load multiple helper files, specify them in an array,

$this->load->helper(array('helper1', 'helper2', 'helper3'));

Q18. Explain how you can hyperlink photos/CSS/JavaScript from a view inside the codeigniter?

Ans: In HTML, there's no Codeigniter manner, as such it's far a PHP server aspect framework. Just use an absolute path on your resources to link the pix or CSS or JavaScript from a view in CodeIgniter:

/css/patterns.Css

/js/question.Hypertext Preprocessor

/img/news/566.Gpg

Q19. Explain CodeIgniter library. How will you load it?

Ans: CodeIgniter offers a wealthy set of libraries. It is an vital part of CodeIgniter as it will increase the growing velocity of an software. It is located within the gadget/library.

It can be loaded as follows;

$this->load->helper(array('helper1', 'helper2', 'helper3'));

Q20. Mention what's the default URL pattern used in Codeigniter framework?

Ans: Codeigniter framework URL has 4 important additives in default URL sample.  First we've the server call and next we've got the controller elegance call followed with the aid of controller characteristic call and function parameters on the cease. Codeigniter may be accessed using the URL helper. For example: http://servername/controllerName/controllerFunction/parameter1/parameter2.




CFG