Selim Reza
Selim Reza

Reputation: 372

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,
  ));

Upvotes: 0

Views: 188

Answers (0)

Related Questions