title: codeigniter global array for a model
body: <p>In my controller I want to declare a global variable which will always fetch all areas from my db  </p>
  
  <p>currently I'm passing <code>$data['dropdowns']</code>
  in all methods in my class</p>
  
  <pre><code>{
  $data['dropdowns']=loading some other model method
  $this-&gt;load-&gt;view('commons/header',$data);  
  }
  
  {
    $data['dropdowns']=loading some other model metod
  $this-&gt;load-&gt;view('commons/header',$data);  
  }
  
  {
    $data['dropdowns']=loading some other model metod
  $this-&gt;load-&gt;view('commons/header',$data);  
  }
  
  {
     $data['dropdowns']=loading some other model metod
  $this-&gt;load-&gt;view('commons/header',$data);  
  }
  </code></pre>
  
  <p>the thing is I want to now send <code>$data['area']</code> to all the views without having to declare it again and again in each method</p>
  
  <pre><code>$data['area']= $this-&gt;area_model-&gt;get_all_locations();
  </code></pre>