Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Paginator revisited #38

Closed
mikespub opened this issue Sep 25, 2023 · 4 comments
Closed

[Bug]: Paginator revisited #38

mikespub opened this issue Sep 25, 2023 · 4 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@mikespub
Copy link
Contributor

What happened?

I've been trying to find a good way to extend/replace the OpdsPaginator() so that it can generate the right output in json() or xml() without messing up the feeds in paginate() or using the wrong route(), but I can't seem to find it without some major code surgery.

Ideally I'd like to pass along the actual total, items per page and current page, perhaps with some callback to generate the right route for first/previous/next/last links, and then let json() and/or xml() do its work to generate the correct feed links.

Maybe we could have a public paginate() method in Opds() that could handle that, and not call some protected paginate() inside OpdsEngine()->feed() ?

How to reproduce the bug

Try to paginate

Package Version

1.0.30

PHP Version

8.2

Which operating systems does with happen with?

Linux

Notes

No response

@mikespub mikespub added the bug Something isn't working label Sep 25, 2023
@ewilan-riviere ewilan-riviere self-assigned this Sep 25, 2023
@ewilan-riviere
Copy link
Collaborator

I see, it's a good idea, I will add this feature to create a fully custom paginator ;)

@ewilan-riviere
Copy link
Collaborator

A PR with a XML/JSON support is available: #43

@ewilan-riviere ewilan-riviere mentioned this issue Feb 17, 2024
@ewilan-riviere
Copy link
Collaborator

v2.0.0 ready with new paginate() method!

mikespub added a commit to mikespub-org/seblucas-cops that referenced this issue Feb 18, 2024
@mikespub
Copy link
Contributor Author

Thanks - seems to work fine :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants