Top 30 Codeigniter Interview Questions and Answers
Q1. What Is The Default Method Name In Codeigniter?
As a matter of course regulator generally calls file strategy. If you have any desire to call an alternate strategy, then compose it in the controller?s document and indicate its name while calling the capacity.
Q2. What Are The Security Parameter For Xss In Codeigniter?
Codeigniter has a cross-site prearranging hack counteraction channel. This channel either runs consequently or you can run it according to thing premise, to channel all POST and COOKIE information that go over. The XSS channel will focus on the usually utilized techniques to set off JavaScript or different kinds of code that endeavor to capture treats or other malignant movement. Assuming it recognizes any dubious thing or anything prohibited is experienced, it will change the information over completely to character elements.
Q3. What Is Stable Version Of Codeigniter?
Adaptation: 3.0.5,
Date January 13, 2016
Q4. Why Codeigniter Is Called As Loosely Based Mvc Framework?
Purpose for this is we doesn't have to follow severe mvc design while making application.We can likewise ready to work with model just view and regulators are sufficient to assembled an application.
Q5. Might You at any point Extend Native Libraries In Codeigniter?
Indeed, we can add a lengthy usefulness to a local library by adding a couple of strategies.
Q6. Make sense of Application Flow Chart In Codeigniter?
The accompanying realistic outlines how information streams all through the framework:
CodeIgniter application stream:
The index.php fills in as the front regulator, introducing the base assets expected to run CodeIgniter.
The Router looks at the HTTP solicitation to figure out how ought to be managed it.
On the off chance that a reserve record exists, it is sent straightforwardly to the program, bypassing the typical framework execution.
Security. Before the application regulator is stacked, the HTTP demand and any client submitted information is separated for security.
The Controller stacks the model, center libraries, assistants, and some other assets expected to deal with the particular solicitation.
The settled View is delivered then shipped off the internet browser to be seen. In the case of storing is empowered, the view is reserved first so that on ensuing solicitations it very well may be served.
Q7. Make sense of Mvc In Codeigniter?
CodeIgniter depends on the Model-View-Controller improvement design. MVC is a product approach that isolates application rationale from show. By and by, it allows your pages to contain insignificant prearranging since the show is independent from the PHP prearranging.
The Model addresses your information structures. Commonly your model classes will contain capacities that assist you with recovering, supplement, and update data in your data set.
The View is the data that is being introduced to a client.
A View will regularly be a website page, yet in CodeIgniter, a view can likewise be a page piece like a header or footer. It can likewise be a RSS page, or some other sort of "page".
The Controller fills in as a middle person between the Model, the View, and some other assets expected to deal with the HTTP demand and create a site page.
Q8. Who Developed Codeigniter?
Codeigniter was created by ellislab Inc.
Q9. Make sense of Codeigniter Architecture?
According to specialized perspective, CodeIgniter is powerfully launch (light-weighted), approximately coupled (parts depend exceptionally less on one another) and has part peculiarity (each class and capacities are barely engaged towards their motivation).
Q10. What Are The Most Prominent Features Of Codeigniter?
A rundown of most conspicuous elements of CodeIgniter:
It is an open source system and allowed to utilize.
It is incredibly light weighted.
It depends on Model View Controller (MVC) design.
It has completely unlocked information base classes and backing for a few stages.
It is extensible. You can undoubtedly expand framework by utilizing your own libraries, partners and so forth.
Superb documentation.
Q11. What Is Helper In Codeigniter? How Might You Load A Helper File?
Assistants are the gathering of capacities in a specific classification that help you to fill explicit roles.
In CodeIgniter, there are numerous assistants like:
URL Helpers: helping in making joins.
Text Helpers: perform different text designing schedules.
Treats Helpers: set and read treats.
To stack aide document, utilize the accompanying order:
$this->load->model('ModelName');
Q12. Make sense of Codeigniter File Structure?
following are the envelope structure :-
application:
reserve
Config
Regulators
center
blunders
assistants
snares
language
libraries
logs
models
thirdparty
sees
framework:
center
data set
textual styles
assistants
language
libraries
Q13. In Which Language Codeigniter Is Written?
PHP
Q14. Make sense of Remapping Method Calls In Codeigniter?
Second section of URI figures out which strategy is being called. To supersede it, you can utilize _remap() strategy. The _remap strategy generally get called regardless of whether URI is unique. It abrogates the URI
Q15. What Is Codeigniter?
Codeigniter is an open source structure for web application on PHP. It is approximately founded on MVC example and it is like CakePHP.
Q16. How Might You Connect Models To A Database Manually?
To interface information base physically utilize following language structure,
$this->load->database();
Q17. Make sense of Views In Codeigniter?
View envelope contains all the markup records like header, footer, sidebar, and so on. They can be reused by implanting them anyplace in regulator document. They can't called straightforwardly, they must be stacked in the regulator's record.
Q18. How Might You Load A View In Codeigniter?
View can't be gotten to straightforwardly. It is generally stacked in the regulator document.
Following capacity is utilized to stack a view page:
$this->load->view('page_name');
Q19. Make sense of Controller In Codeigniter?
A regulator is the delegate among models and perspectives to handle HTTP demand and produces a website page. It is the focal point of each and every solicitation on your web application.
Q20. Make sense of Codeigniter Library. How Might You Load It?
CodeIgniter gives a rich arrangement of libraries. It is a fundamental piece of CodeIgniter as it speeds up an application. It is situated in the framework/library.
It very well may be stacked as follows,
$this->load->library('class_name');
Q21. How Might You Create A Library In Codeigniter?
There are three techniques to make a library:
Making a whole new library
Expanding local libraries
Supplanting local libraries
Q22. What Is Basic Codeigniter Url Structure?
Rather than utilizing 'inquiry string' approach, it utilizes a section based approach.
Its construction is as per the following,
abc.com/class/work/ID
class addresses regulator class that should be summoned.
work is the technique that is called.
ID is any extra fragment that is passed to regulators.
Q23. What Are The Features Of Codeigniter? Open Source Framework?
Light Weight
CodeIgniter is Extensible
Unlocked data set classes
Q24. How Might You Add Or Load A Model In Codeigniter?
To stack models in regulator capacities, utilize the accompanying capacity:
$this->load->model('ModelName');
Q25. How You Will Work With Error Handling In Codeigniter?
CodeIgniter allows you to fabricate blunder detailing into your applications utilizing the capacities depicted beneath. What's more, it has a blunder logging class that licenses mistake and investigating messages to be saved as message documents.
show_error('message' [, int $statuscode= 500 ] )
This capacity will show the mistake message provided to it utilizing format application/blunders/errorgeneral.php.
show_404('page' [, 'logerror'])
This capacity will show the 404 blunder message provided to it utilizing layout application/mistakes/error404.php.
log_message('level', 'message')
This capacity allows you to compose messages to your log documents. You should supply one of three "levels" in the main boundary, showing what kind of message it is (investigate, blunder, data), with the actual message in the subsequent boundary.
Q26. How Do You Use Aliases With Autoloading Models In Codeigniter?
We could auto at any point load model like this:
$autoload['model'] = array(array('usersmodel', 'clients'), array('newsmodel', 'news'), 'categorymodel');
Q27. How To Access Config Variable In Codeigniter?
$this->config->item('variable name');
Q28. How Might You Extend Class In Codeigniter?
You need to assemble a document name application/center/MY_Input.php and proclaim your class with Class MY_Input expands CI_Input {}to broaden the local info class in CodeIgniter.
Q29. How To Get Random Records In Mysql Using Codeigniter?
We can utilize this:
$this->db->order_by('id','RANDOM');
Q30. How To Unset Session In Codeigniter?
$this->session->unsetuserdata('somename');;
