I have two controllers. Let's say A and B.
For clarity's sake I want to run some functions in B controller but I have trouble getting back to A.
Of course I could just run
$this->load->view('pages/examplepage');
But this example page has to get data from database and of course it gives me an error that it doesn't have the necessary data.
Now I could just run
$data['exampledata'] = $this->example_model->get_data();
$this->load->view('pages/examplepage', $data);
Now for couple of rows it's okay but isn't there a better way? What am I missing? Can't I just run the A controller's function from B controller and let the already existing function do the job?