Articles → PHP CODEIGNITER → Create Your First Controller In Codeigniter
Create Your First Controller In Codeigniter
What Is The Controller?
Where Do You Find The Controllers?
Click to Enlarge
Create Your First Controller
- Create a new file "About.php"
- Inside the controller, add the following command
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class About extends CI_Controller
{
public function Index()
{
$this->load->view('About');
}
}
Click to Enlarge
Click to Enlarge
Index Function
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class About extends CI_Controller
{
public function CallAbout()
{
$this->load->view('About');
}
}
Click to Enlarge
Click to Enlarge