Yii ::: Cgridview ::: Dataprovider Is Not Working / Class Is Not Passing Data

I am trying to pass data from another model to my view page with CGridView and controller. It is showing some error ::: urlencode() expects parameter 1 to be string, array given

I created a function for dataProvider.

controller

===========




    	public function actionClassA()

	    {

		$dataProvider = new CActiveDataProvider('Codesparam', array(

		    'criteria'=>array(

		        'condition'=>'cm_type="Branch"',

		    ),

		));

		 $this->render('admina', array('dataProvider' => $dataProvider));

	   }



view

====




      $this->widget('zii.widgets.grid.CGridView', array(

	  'id'=>'productmaster-grid',

	  'dataProvider'=>$dataProvider,

	  //'filter'=>$result,

	  ));



Please let me get some help from your side. Thanks in advanced.

Try this…




public function actionClassA()

{

    $data = Codesparam::model()->findAll(array('condition'=>'cm_type="Branch"'));

    $dataProvider = new CActiveDataProvider($data);

    $this->render('admina', array('dataProvider' => $dataProvider));

}