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

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>