CodeIgniter Interview Questions | Eklavya Online

CodeIgniter Interview Questions

Explain views in CodeIgniter.

View folder contains all the markup files like header, footer, sidebar, etc. They can be reused by embedding them anywhere in controller file. They can’t call directly, and they have to be loaded in the controller’s file.

What are the hooks in CodeIgniter?

The Hook is a feature in CodeIgniter that provides a way to change the inner working of the framework without hacking the core files. It facilitates you to execute a script with a particular path within the CodeIgniter. Usually, it is defined in the application/config/hooks.php file.

How can you load a view in CodeIgniter?

The View can’t be accessed directly. It is always loaded in the controller file. Following function is used to load a view page: $this->load->view(‘page_name’); Write your view’s page name in the bracket. You don’t need to specify .php unless you are using some other extension.

Explain controller in CodeIgniter.

A controller is the intermediary between models and views to process the HTTP request and generates a web page. It is the center of every request on your web application. Consider following URI, In this URI, CodeIgniter try to find Front.php file and Front class.

What are different types of hook points in CodeIgniter?

A list of different types of hook points in CodeIgniter: post_controller_constructor – It is called immediately after your controller is started but before any method call. pre_controller – It is called immediately before your controller being called. At this point, all the classes, security checks, and routing have been done. post_sytem – It is called …

What are different types of hook points in CodeIgniter? Read More »

What is the default controller in CodeIgniter?

The file specified in the default controller loaded by default when no file name is mentioned in the URL. By default, it is welcome.php which is the first page to be seen after installing CodeIgniter. With URL localhost/codeigniter/ Welcome.php will be loaded as there is no file name mentioned in the URL. Although as per …

What is the default controller in CodeIgniter? Read More »

What are CodeIgniter drivers?

These are a particular type of library that has a parent class and many child classes. These child classes have access to the parent class, but not to their siblings. Drivers are found in system/libraries folder.