Yii 分页器Pagesize的设置方法

public function search()
	{
		// @todo Please modify the following code to remove attributes that should not be searched.

		$criteria=new CDbCriteria;
                
                if(!isset($_GET['Testlogs_sort'])){
                    //增加的代码,按ID号降序排列;
                    $criteria->order='test_id desc';
		}


		$criteria->compare('test_id',$this->test_id,true);
		$criteria->compare('test_msg',$this->test_msg,true);
		$criteria->compare('test_create_time',$this->test_create_time);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
                        'pagination'=>array(
                            'pageSize'=>20
                        )
		));
	}

你可能感兴趣的:(YII框架)