Skip to content

Conversation

taobig
Copy link

@taobig taobig commented Jul 7, 2025

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

@taobig
Copy link
Author

taobig commented Jul 7, 2025

Usage:

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

@taobig taobig force-pushed the feature/issue_100 branch from 2b99324 to 23d0cf8 Compare July 7, 2025 01:30
@taobig taobig force-pushed the feature/issue_100 branch from 23d0cf8 to e720f58 Compare July 7, 2025 01:33
@@ -148,6 +149,17 @@ class LinkPager extends Widget
*/
public $disableCurrentPageButton = false;

/**
* @var array Number of records displayed per page. If the array is empty, this area will not be displayed.
* e.g. [5=>5, 10 => 10, 20 => 20, 50 => 50]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* e.g. [5=>5, 10 => 10, 20 => 20, 50 => 50]
* e.g. [5 => 5, 10 => 10, 20 => 20, 50 => 50]

What's the meaning of keys/values?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samdark I've updated the comments

@samdark samdark requested a review from terabytesoftw July 8, 2025 06:34
@simialbi
Copy link
Collaborator

simialbi commented Jul 8, 2025

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 🤔

@taobig taobig force-pushed the feature/issue_100 branch from 30efe9f to 29c6b03 Compare July 8, 2025 10:04
@taobig
Copy link
Author

taobig commented Jul 8, 2025

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

My goal:
image

@taobig
Copy link
Author

taobig commented Aug 3, 2025

@terabytesoftw Can you review this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants