Minggu, 01 Oktober 2017

Pagination Yii1

    $perPage = 2;
    $offset = ($page > 1) ? ($page * $perPage) - $perPage : 0;

    $criteria = new CDbCriteria;
    $criteria->order = 'id DESC';
    $criteria->limit=$perPage;
    $criteria->offset=$offset;

    $templates = Users::model()->findAll($criteria);

0 komentar:

Posting Komentar