yii2-bootstrap5
yii2-bootstrap5 copied to clipboard
Add pageSizeOptions and goToPageLabel options for LinkPager
| Q | A |
|---|---|
| Is bugfix? | ❌ |
| New feature? | ✔️ |
| Breaks BC? | ❌ |
| Fixed issues | #100 |
Usage:
[
'class' => \yii\bootstrap5\LinkPager::class,
'pagination' => $dataProvider->getPagination(),
...
// Add 2 options:
'pageSizeOptions' => [5=>5, 10 => 10, 20 => 20, 50 => 50],
'goToPageLabel' => true,
]
Can't the page size not simply be done via pagination initialisation? For me this is nothing to be handled in the widget, it comes down to data provider. E.g.
$pager = new LinkPager([
'pagination' => [
'pageSize' => 50
]
]);
And the goto page feature is a nice idea, but nothing officially documented in https://getbootstrap.com/docs/5.3/components/pagination/#overview so I'm not sure if it makes sense if we add this feature 🤔
@simialbi I've updated the comments so you can review it again.
My goal:
@terabytesoftw Can you review this PR?