How to customize dataProvider

I am working on the categories listing page,in which i use CActiveDataProvider & zii.widgets.CListView combination to develop listing & pagination it works great!

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

‘itemView’=>’_view’,

));

When we use CListView like above,

It’s functionality may works in foreach to iterate the itemView, to create listing with associative dataprovider,

How could i give some conditions between this foreach or any other mechanism which CListView used

(without use of dataprovider query)

Kindly Please reply,I stuck here & i have to deliver it earlier :-[

If you r not getting me, Plz reply i will explain u in detail

not sure if this is the reply u asked for, but to add conditions to the CListView, i think that you could try the following (not tested)




$criteria = new CDbCriteria();

$criteria->condition = 'something =:st';

$criteria->params = array(':st',$valueToCheck);


$dataProvider=new CActiveDataProvider('Model',

array(

'criteria'=>$criteria

)

);




if it’s not the answer you wanted, please, give more details

hope it helps

regards

Also, regarding customization, have a look at the API reference (data/sort/pagination/keys/…). You may also want to override methods of the C…DataProvider class.

/Tommy