Provide TWO DataProviders from Controller

In the view component I have two CGridView. Each CGridView needs DataProvider from controller. I know how to provide one DataProvider. However, I don’t know HOW TO provide two DataProviders.

Is it possible to provide two DataProviders from Controller for each of CGridView?




...

criteria=new CDbCriteria();

...

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

			'criteria'=>$criteria,

			'sort'=>array(

				'defaultOrder'=>'REQ_ID DESC',

				),

			));

							


$dataProvider->pagination = array('pageSize'=>'10');


$this->render('index',array(

	'dataProvider'=>$dataProvider,

));



Simply add the second dataprovider also to the second parameter of the render method.




$this->render('index',array(

  'dataProvider1'=>$dataProvider1, 

  'dataProvider2'=>$dataProvider1,

));