CListView and CArrayDataProvider

So I used CListView and CArrayDataProvider

$this->widget(‘zii.widgets.CListView’, array(

'dataProvider'=> $dataProvider,




where dataProvider is a CArrayDataProvider but the list view widget is not recognizing the data provider. Does CLISTVIEW work with CArrayDataProvider? If not, how can I make it work?


yes, you can use CArrayDataProvider with CListView. Can show the code for creating the CArrayDataProvider ?

Here’s the code:

$sql = "SELECT profiles.firstname, profiles.lastname, friendship.inviter_id, friendship.friend_id, profiles.user_id, friendship.status FROM profiles INNER JOIN friendship ON (profiles.user_id =  friendship.inviter_id AND friendship.friend_id = '" . Yii::app()->user->id . "') OR (profiles.user_id =  friendship.friend_id AND friendship.inviter_id = '" . Yii::app()->user->id . "') WHERE profiles.firstname LIKE '%" . $search . "%' OR profiles.lastname LIKE '%" . $search . "%'";


$rawData = $conn->createCommand($sql)->queryAll();

$dataProvider= new CArrayDataProvider($rawData, array(





	  ), ),




Well the code looks ok … check out what is in $rawData and after all do you get an error or what ?


I do like this ,

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


	'dataProvider'=>[b]new CArrayDataProvider(Verfpf::getIndexfpf()),[/b]





but, the ID is not here




give a help please

tanks …