yii2-bootstrap5 icon indicating copy to clipboard operation
yii2-bootstrap5 copied to clipboard

Add pageSizeOptions and goToPageLabel options for LinkPager

Open taobig opened this issue 4 months ago • 4 comments

Q A
Is bugfix?
New feature? ✔️
Breaks BC?
Fixed issues #100

taobig avatar Jul 07 '25 01:07 taobig

Usage:

[
        'class' => \yii\bootstrap5\LinkPager::class,
        'pagination' => $dataProvider->getPagination(),
        ...
        // Add 2 options:
        'pageSizeOptions' => [5=>5, 10 => 10, 20 => 20, 50 => 50],
        'goToPageLabel' => true,
]

taobig avatar Jul 07 '25 01:07 taobig

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 avatar Jul 08 '25 09:07 simialbi

@simialbi I've updated the comments so you can review it again.

My goal: image

taobig avatar Jul 08 '25 10:07 taobig

@terabytesoftw Can you review this PR?

taobig avatar Aug 03 '25 09:08 taobig