Scroll pager scrolling in Yii2

I am using Yii2 with a scroll pager extension: http://kop.github.io/yii2-scroll-pager/

Here's my code:

echo yii\widgets\ListView::widget([
    'dataProvider' => $boards,
    'itemView' => 'boards',
    'layout' => $template,
    'itemOptions' => ['class' => 'item'],
    'pager' => ['class' => \kop\y2sp\ScrollPager::className()]
]);

      

and I am collecting data. The creator from modal code is shown below.

$dataProvider = new ActiveDataProvider([
        'query' => Boards::find(),
        'pagination' => array('pageSize' => 3),
    ]);

    return $dataProvider;

      

But I am getting the following exception

PHP Notice - yii \ base \ ErrorException Undefined variable: boards

Can anyone tell me what is wrong?

+3


source to share


1 answer


Is the $ board defined?

From what I paint

'dataProvider' => $boards,

      



not defined, I don't think it has anything to do with the ScrollPager. Try to remove

'pager' => ['class' => \kop\y2sp\ScrollPager::className()]

      

you will probably get the same error.

0


source







All Articles