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?
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:
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.
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:
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:
Q16. Mention which might be the safety parameter for XSS in the CodeIgniter?
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'));
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.