Добрый день! Использую стандартную пагинацию Yii2:
Есть массив $records
Array
(
[0] => Array
(
[RecipientLegalName] => AAA
[Service Name] => BBB
[Payment Identifier] => CCC
[Payment Number] => DDD
[Payment Account] => EEE
[Recipient Sum, MDL] => FFF
[Payment State] => Завершен
[State Time] => 2018-08-01 00:30:05
)
[1] => Array
(
[RecipientLegalName] => QQQQ
[Service Name] => WWWWW
[Payment Identifier] => TTTT
[Payment Account] => PPPP
[Recipient Sum, MDL] => FFF
[Payment State] => Завершен
[State Time] => 2018-08-01 07:32:53
)
)
Как использовать этот масссив для пагинации в коде ниже?
$pages = new Pagination(['totalCount' =>count($records)]);
$posts = $records->offset($pages->offset)->limit($pages->limit)->all();
return $this->render('index',compact('records','pages','posts'));
Выбивает ошибку
Call to a member function offset() on array