0

In codeigniter call another controller method from controller in code igniter

class ManualTrackingUpdate extends MY_Controller 
{
    
    ##constructor Define method
    public function __construct() 
    {
        parent::__construct();
        
        $this->load->library('form_validation');
        $this->load->model("TrackingUpdateInApp_model","MTUD");
      
    }  

public function UpdateDetails(){
        
     
   
       // call model 
      $Insert_details = $this->MTUD->InsertTrackingDetails($columns);
      
      // call here another controller method

    }
    
    }

how can do this with codeigniter

2

2 Answers 2

0
class ManualTrackingUpdate extends MY_Controller 
{

    ##constructor Define method
    public function __construct() 
    {
        parent::__construct();

        $this->load->library('form_validation');
        $this->load->model("TrackingUpdateInApp_model","MTUD");  
    }  

    public function UpdateDetails()
    {
         // call model 
         $Insert_details = $this->MTUD->InsertTrackingDetails($columns);

         include('User.php'); 
         $user =  new User();
         $user->abc();
    }
}
Sign up to request clarification or add additional context in comments.

3 Comments

i don't know its modularity wise right or not, but it works for me.
if it's working for you then close your question by accepting answer.
0

I think this stuff will work for you. not sure but just try it.

constructor.

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

and now call the function using

$this->controllername->functioname();

1 Comment

getting Unable to load the requested class: TrackingUpdation i am using HMVC

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.