Is it possible to call a method in controller from a model?
if ($this->db->trans_status() === TRUE)
{
//calling a method in controller
}
Is it possible to call a method in controller from a model?
if ($this->db->trans_status() === TRUE)
{
//calling a method in controller
}
If you need to do that, there's something wrong with your design. The controller is responsible for everything that happens in the view (template). But the model is responsible for manipulating and retrieving records from the database.
As a general rule, if the function is going to be used in more than one template, put it in the model. Otherwise, it goes in the controller.
The model should not know about its controllers. Maybe a redesign of your system will be more appropriate in this case.
Here is a link to similar thread.