CActiveDataProvider Queries in DropDownLists


I’m running a query with a CActiveDataProvider and producing a list that I push into a CActiveForm->dropDownList. The query returns data but its always limited to 10 results. I tried adding a CDbCriteria and set the limit to -1 thinking it would return all the results but it didn’t work. How can I run it in a way that all of the data ends up in the list.

Here is my code for the getSites function:

public function getSites()


            /*$criteria = new CDbCriteria();


            $criteria->limit= '-1';



            $dataProvider=new CActiveDataProvider('Permit');//,array('criteria'=>$criteria));





            foreach($data as $s)


                $return[$s->siteID] = $s->siteName;



            return $return;


Here is my code for the form:

 <div class="row">

		<?php echo $form->labelEx($model,'siteID'); ?>

		<?php echo $form->dropDownList($model,'siteID', $model->getSites()); ?>

		<?php echo $form->error($model,'siteID'); ?>


Any help is appreciated,



You can use findAll() directly, no need for involving a dataprovider.

$data = Permit::model()->findAll($criteria);



$form->dropDownList($model, 'fk_field', CHtml::listData(Model::model()->findAll($criteria), 'valueField', 'textField'));