title: Error message keeps coming back saying the array is not defined.
body: <p>I'm developing a website using Codeigniter. The structure site is simple, I have dynamic menu and content retrieving DB in Model. Then assign a method to call both of them in Controller. </p>
  
  <p>I have that weird error message keeps coming back saying the array is not defined.</p>
  
  <p>I can get tabPhotos, it contains datas.
  View: </p>
  
  <pre><code>&lt;div id="container"&gt;
      &lt;div id="photos"&gt;
          &lt;?php echo "Count: ". count($tabPhotos); ?&gt;
          &lt;ul&gt;
              &lt;?php if (!is_array($tabPhotos) || empty($tabPhotos)) :?&gt;
                  &lt;?php return null; ?&gt;
  
                  &lt;?php foreach ($tabPhotos as $item) : ?&gt;
                      &lt;?php echo "Model: " . $item-&gt;url; ?&gt;                   
                  &lt;?php endforeach; ?&gt;
              &lt;?php endif; ?&gt;
          &lt;/ul&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>public function loadMenu($file) {
      $data['tabMenuItems'] = $this-&gt;qdphoto_model-&gt;getAllMenuItems();
      $this-&gt;load-&gt;view($file, $data);    
  }
  
  
  public function loadCategoryPage($file, $category='Book 1') {
      $data['tabPhotos'] = $this-&gt;qdphoto_model-&gt;getAllPicturesByCategory($category, 'url, model');
  
      $this-&gt;load-&gt;view($file, $data);        
  }
  </code></pre>