I am trying to move from codeigniter 2 to codeigniter 3. Normally in most of our functions in our controller we call other controller sometimes like this,
$this->load->controller('login');
return $this->login->index();
But in codeigniter 3 this crashes, I checked how routes worked in this stack overflow question.
How to load a controller from another controller in codeigniter?
But the above url does not work for me, since changing routes will cancel all the database trasactions I use with mysql gets cancelled.
Is there a good solution to load different controller, I thought of moving it to a library and calling it like that but I think there is a better way. Also the HMVC might be a solution but its still doesn't solve the issue for a simple purpose.