5

I'm studying yii2 framework. I have a trouble when use listview wiget. When I click next page I want to update page but not reload. but I don't know how do it? this is url when click next page:

http://......&page=1&per-page=5

Please help me?

Thank you so much.

Tam Vo
  • 175
  • 2
  • 3
  • 10

1 Answers1

8

Do like this:

use yii\widgets\Pjax;
Pjax::begin([
'enablePushState' => false, // to disable push state
'enableReplaceState' => false // to disable replace state
]);
echo ListView::widget([...]);
Pjax::end();

For more info refer this link: http://www.yiiframework.com/doc-2.0/yii-widgets-pjax.html

nicolascolman
  • 549
  • 4
  • 15