Hi I am using ScrollPager module to make an infinite scroll page. The module is using the ListView widget to pass each page data into a view.
I am currently trying to use it in this way :
You have the first element which is the view containing the infinite scroll pager :
<?= ListView::widget([
'dataProvider' => $provider,
'itemOptions' => ['class' => 'item'],
'itemView' => '_item-remaining',
'pager' => ['class' => \kop\y2sp\ScrollPager::class]
]); ?>
The value in provider is an ActiveDataProvider and I simplified the view _item-remaining to debug it easily with a simple line:
<div>
<p><?= $dataProvider->id ?><p>
<div>
The yii\base\ErrorException returned is : Undefined variable: dataProvider.
It seems this line is not correct :
"'dataProvider' => $provider," although the yii and the module documentation tell it should work.
Here it is : ScrollPager’s github
There might be something I don’t get.
Thanks in advance for your help !