Wednesday, November 6, 2013

Yii set the default sort order

class MyModel extends CActiveRecord {
...

public function search(

          return new CActiveDataProvider($this, array(
              'criteria' => $criteria,
              'pagination' => array(
                  'pageSize' => 100,
              ),
              'sort' => array(
                  'defaultOrder' => 'firstname, lastname DESC',
              )
          ));

No comments:

Post a Comment

About

Blogger templates