title: send a variable to the view with codeigniter
body: <p>I have a function, that count the visits of my web site, I tried to send a variable into the view but it doesn't work, the variable has to pass trought a file that contents the templates. When the variable I pass directly to the view it works, but other way doesn't. Please help me. Thanks.</p>
  
  <p>in the controller</p>
  
  <pre><code>$query = $object-&gt;Searcher_visits();
  if ($query-&gt;num_rows &gt; 0) {
  while ($query-&gt;result()) {
  $current_date = $list['date'] = $query-&gt;date; 
  $count = $obj_forum-&gt;visits($current_date);
  $list2['num'] = $count-&gt;num;
  $list2['current_date'] = $current_date;
  }
  }
  $data['list2'] = $list2;
  $data['list'] = $lis;
  $this-&gt;load-&gt;view('template/general_template/template', $data);
  </code></pre>
  
  <p>in the view (this view is the left menu)</p>
  
  <pre><code>&lt;table border="1" width="250px" cellpading="5px" cellspacing="5px"&gt;';
  &lt;tr&gt;&lt;td&gt;FECHA&lt;/td&gt;&lt;td&gt;VISITAS&lt;/td&gt;&lt;/tr&gt;';
  tr&gt;&lt;td&gt;&lt;?php echo $list2['current_date']; ?&gt;&lt;/td&gt;
  &lt;td align="right"&gt;&lt;?php echo $list2['num'];?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>the template</p>
  
  <pre><code>&lt;?php
  $this-&gt;load-&gt;view('header');
  $this-&gt;load-&gt;view('banner');
  $this-&gt;load-&gt;view('left_menu');
  ?&gt;
  </code></pre>