title: Codeigniter3 moving from one controller to another
body: <p>I have two controllers. Let's say <strong>A</strong> and <strong>B</strong>.</p>
  
  <p>For clarity's sake I want to run some functions in <strong>B controller</strong> but I have trouble getting back to <strong>A</strong>.</p>
  
  <p>Of course I could just run</p>
  
  <pre><code>$this-&gt;load-&gt;view('pages/examplepage');
  </code></pre>
  
  <p>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.</p>
  
  <p>Now I could just run</p>
  
  <pre><code>$data['exampledata'] = $this-&gt;example_model-&gt;get_data();
  $this-&gt;load-&gt;view('pages/examplepage', $data);
  </code></pre>
  
  <p>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 <strong>A controller's</strong> function from <strong>B controller</strong> and let the <strong>already existing function</strong> do the job?</p>