Two or More CActiveDataProviders for CListView?

Hi there,

Is it possible to use two or more CActiveDataProviders in a CListView? Example -

Index.php




<?php $this->widget( 'zii.widgets.CListView', array(

    'dataProvider' => $dataProvider,

    'dataProvider2' => $dataProvider2,

    'itemView' => '_view',

    'summaryText' => '',

) ); ?>



_View.php




<?php echo GxHtml::encode( $data->id ); ?>

<?php echo GxHtml::encode( $data2->id ); ?>



If not, any suggestions for another approach?

Thanks!

I think the solution here is to either create a view or a new model which combines these two models, then build a dataprovider for that.

Interesting thoughts. The code in the partial requires the data from the multiple models. Perhaps if I avoid the partial, how can I access the data directly in $dataProvider returned in the model? When I -




echo $dataProvider->id;



The string "Post" is returned, the model. How can I access the id and other columns in the database? Any thoughts or suggestions?

Thanks!