title: How to iterate over Yii CActiveDataProvider object?
body: <p>How to iterate over a dataprovider object? I want to access the 'name' field of each row returned and build a list. Can you help?</p>
  
  <p><strong>Table structure for table/model <code>categories</code></strong></p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `categories` (
    `idCategory` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(64) NOT NULL,
    PRIMARY KEY (`idCategory`) USING BTREE
  ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=55 ;
  </code></pre>
  
  <p>*<strong><em>Function in my Controller Categories</em>*</strong></p>
  
  <pre><code>    $names = array();
      public function returnCategoryNames()
  {
      $dataProvider= new CActiveDataProvider('Categories');
      $dataProvider-&gt;setPagination(false);
      $count = $dataProvider-&gt;totalItemCount();
  
      for($i = 0; $i &lt; $count; $i++){
  
               // this is where I am lost...
               $myname = $dataProvider-&gt;data[$i]-&gt;name;
               array_push($names, $myname);
  
      }   
  
         return $names;
  
  }
  </code></pre>