class MyController extends CI_Controller { public function index() { echo "Hello World!"; } }
class Welcome extends CI_Controller { public function index() { $this->load->view('welcome_message'); } }This example illustrates how to load a view file in CodeIgniter. The 'Welcome' controller has an 'index' method which loads and displays the 'welcome_message' view file. Package/Library: The CI_Controller class is a part of CodeIgniter's core system and is included in the framework's 'system' directory.