Modify your CActiveDataProvider in Yii Framework

This is very useful things who are using Widget

  1. $dataProvider=new CActiveDataProvider(‘Post’, array(
  2.     ‘criteria’=>array(
  3.         ‘condition’=>‘status=1′,
  4.         ‘order’=>‘create_time DESC’,
  5.         ‘with’=>array(‘author’),
  6.     ),
  7.     ‘pagination’=>array(
  8.         ‘pageSize’=>20,
  9.     ),
  10. ));

 

 

Leave a Reply