Sharing Latest 35+ Codeigniter Interview questions and their answers that asked by an interviewer in Codeigniter interviews. Read about helpers, sessions, hooks, Routing, Constants ORM supported by Codeigniter and more
The default URL pattern in CodeIgniter consists of 4 main components. They are :
Prepare 10 Essential Magento Interview Questions
There are three message types in Codeigniter. They are :
// Setting a config variable dynamically $this->config->set_item('variable_name', value); // Getting value of config variable in Codeigniter. $this->config->item('variable_name');
$this->load->library(‘library_name’); method is used to load a library in CodeIgniter.
//Loading Cart library
Using Cart library methods
$data = array( 'id' => 'sku_9788C', 'qty' => 1, 'price' => 35.95, 'name' => 'T-Shirt', 'options' => array('Size' => 'L', 'Color' => 'Red') ); $this->cart->insert($data);
To autoload resources, open the application/config/autoload.php file and add the item you want loading to the autoload array. You’ll find instructions in that file corresponding to each type of item.
CodeIgniter is a powerful MVC based PHP framework with a very small footprint, built for developers who need a simple and elegant toolkit to create full-featured web applications.Also Prepare: Frequently Asked Kohana Framework interview questions
As the name suggests, helpers help you with tasks.Each helper file is simply a collection of functions in a particular category.They are simple, procedural functions.Each helper function performs one specific task, with no dependence on other functions.
CodeIgniter does not load Helper Files by default, so the first step in using a Helper is to load it. Once loaded, it becomes globally available in your controller and views.
Helpers are typically stored in your system/helpers, or application/helpers directory
Loading a helper file is quite simple using the following method:
Where name is the file name of the helper, without the .php file extension or the “helper” part.
Never Miss an Articles from us.