title: Codeigniter passing data from model to controller parser
body: <p>I am about to implement the parser class to my codeigniter project and would like some guidance in passing the data from my model to the parser array. Which is the better more efficient way to do it.</p>
  
  <p>My model gets the data and returns it to the controller. How can I get it into the array in the controller?</p>
  
  <p><strong>Model:</strong></p>
  
  <pre><code>    function getSeo($data){
  
      $this-&gt;db-&gt;select('seo_title, seo_description, seo_keywords');
      $this-&gt;db-&gt;from('content');
      $this-&gt;db-&gt;where($data);
  
      $query = $this-&gt;db-&gt;get();
  
       $data = array();
  
  foreach ($query-&gt;result() as $row) {
      $data[] = array(
           'seo_title' =&gt; $row-&gt;seo_title,
          'seo_description' =&gt; $row-&gt;seo_description,
            'seo_keywords' =&gt; $row-&gt;seo_keywords
      );
  }
  
  return $data;
  
  }
  </code></pre>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>     $viewdata['pageseo'] = $this-&gt;Content_model-&gt;getSeo($data);
  
  $viewdata = array(
      'seo_title' =&gt; 'My seo Title',
      'seo_description' =&gt; 'My seo description',
       'seo_keywords' =&gt; 'My seo keywords',
      );
  </code></pre>
  
  <p>What is the best way to get the data from my model into the '$viewdata' array, how is it done????</p>