There is a provider date:

$dataProvider = new ActiveDataProvider([ 'query' => Shop::find()->where(['status'=>1, 'men' => 1])->orderBy('id DESC'), 'pagination' => [ 'pageSize' => 10, ], ]); 

Now it automatically inserts pagination immediately after the last article, how to change its location?

  • for example via css? - Alexey Shimansky
  • @ Alexey Shimansky Probably I need to change the view and not positionom set - Gaioz

1 answer 1

It depends on how you display it in the view. for example, if via the GridView widget:

 <?= GridView::widget([ 'dataProvider' => $dataProvider, 'layout' => "{summary}\n{items}\n{pager}", 'columns' => [ 'id', 'name', // ... ], ]) ?> 

Edit the layout of the pager in the layout 'layout' as you need.

If ListView look here ;

Or you can use LinkPager widget and place it anywhere.

  <?php echo LinkPager::widget([ 'pagination' => $dataProvider->pagination, ]); ?>