当我拿到这些记录然后得到这个错误如何解决它?
public function actionIndex() {
$query = Site::model();
$pagination = new CPagination([
'defaultPageSize' => 5,
'totalCount' => $query->count(),
]);
$countries = $query->orderBy('name')
->offset($pagination->offset)
->limit($pagination->limit)
->all();
return $this->render('view', [
'countries' => $countries,
'pagination' => $pagination,
]);
}
答案 0 :(得分:1)
你应该从你的代码中区分yii1和yii2.你一起使用了yii1和yii2。