What is the basic CodeIgniter URL structure?

Instead of using ‘query-string’ approach, it uses a segment based approach. Its structure is as follows, abc.com/class/function/ID The class represents a controller class that needs to be invoked. The function is the method that is called. ID is an additional segment that is passed to controllers. In CodeIgniter, the basic URL structure follows a pattern … 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 … Read more

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, abc.com/index.php/front/ In this URI, CodeIgniter try to find Front.php file and Front class. In CodeIgniter, a controller is a crucial component of … Read more

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. In CodeIgniter, you can load a view using the load->view() … Read more

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. In CodeIgniter, views are an essential component of the MVC (Model-View-Controller) architectural pattern. Views are responsible for presenting … Read more