CodeIgniter Framework Coding
CodeIgniter: How To Call A Controller from another Controller
October 2, 2015
0

Suppose you have two controllers file, one is users.php and another one is welcome.php.
For some reason, you want to load the a function from users controller from inside the controller welcome.

Write the below code in your welcome controller file:

$this->load->library('../controllers/users');


$this->users->function_name();

About author

ZERIN

CEO & Founder (BdBooking.com - Online Hotel Booking System), CEO & Founder (TaskGum.com - Task Managment Software), CEO & Founder (InnKeyPro.com - Hotel ERP), Software Engineer & Solution Architect

How do i install older version of CI4 using composer

Sometimes when you run git update & composer u...

Read more

hitpath API: Read Affiliates Record

<?php $offset = 0; $limit = 10; $url = "http://...

Read more

hitpath API: Read Campaigns Record

<?php $offset = 0; $limit = 10; $url = "http://...

Read more

There are 0 comments

Leave a Reply

Your email address will not be published. Required fields are marked *