1.

Explain controllers in codeIgnitor.

Answer»

Controller is an intermediary between MODELS and views. It PROCESSES HTTP requests and generates an HTML response. It’s the central part of every REQUEST coming to application. 

knowledgehut.com/interview-questions/codeignitor

Codeintor will try to find Interview-questions.PHP file and InterviewQuestions Class. 

Basic syntax of controller is like : 

<?php defined(‘BASEPATH’) or exit(‘Direct script execution not allowed’’);  Class First extends CI_Controller { Public function index() { //code goes here }

Please note that FILENAME here would be First.php and classname will be First.

Default controller for Codeigniter is Welcome.php which we can see post installation.



Discussion

No Comment Found