Building view from model directly In Codeigniter?
<p>I have a header that contains a navigation menu for categories.</p>

<p>this menu is created by data from database, and I've created a model, and this is the function which returns the categories list in that model :</p>

<pre><code>function categories_list()
  {
    $query=$this-&gt;db-&gt;get("produits_categories");
    if($query-&gt;num_rows()&gt;0)
    {
      $i = 0;
      foreach($query-&gt;result() as $rows)
      {
        $items[$i] = $rows-&gt;title;
        $i++;
      }
      return $items;
</code></pre>

<p>the problem is that I don't know how to use the controller to pass data to the header view, because the header view is called by other controllers.</p>

<p>for exemple I have the client controller which load the header view, the client view and the footer view, so if I need to pass data I have to call the categorie controller and pass data to the header view in every page that uses the header.</p>

<p>Isn't there any other method to pass data to view directly ?</p>
