ISergeyV
(Isayevskiy)
1
ver. Yii 2.0
public function actionNews()
{
$query = News::find()->orderBy('id')->all();
$pages = new Pagination([
'totalCount' => $query->count(),
'defaultPageSize' =>10,
]);
Call to a member function count() on a non-object
?
‘totalCount’ => count($query),
1 Like
ISergeyV
(Isayevskiy)
3
I do this, but next step…
$models = $query->offset($pages->offset)->limit($pages->limit)->all();
as result
Replying to Call to a member function offset() on a non-object