-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add a pagination component #832
Conversation
Update PaginationService.php
This reverts commit 475996a.
This simplifies the class usage, and since the class is completely useless before generation there is no reason the developer should have to call the method manually.
Hopefully this class can be used outside of publications as well
Breaks with the Laravel naming rules in favour of fluency
This reverts commit 418d8c5.
This reverts commit b129b6b.
Yes, this is very "left-to-right" centric, but so is the code. I'm going for clarity here, and if/when we add support for RTL this is not the place to start. I use LTR, so that's what I'm doing. Open to discussion and collaboration, but like I said, this is not the place to start.
… reduce confusion between other usages of the word page
Codecov Report
@@ Coverage Diff @@
## master #832 +/- ##
=============================================
Coverage 100.00% 100.00%
- Complexity 1209 2490 +1281
=============================================
Files 145 292 +147
Lines 3186 6522 +3336
=============================================
+ Hits 3186 6522 +3336
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
…if there are no routes This means that if you set a route prefix to posts, links will be generated as posts/page-1.html, even if the route does not exist. This allows the pagination links to be generated outside of the kernel (such as in a post build task)
I wonder if we could add a helper method that generates the paginated virtual pages / blade pages (using a specified template) this could then be used in a provider when booting to inject those pages into the page collection. Something for another PR. |
About
Adds a class to aid in creating paginated pages, and with a corresponding component to render the links. The PR does not implement any actual pagination, just the framework to do so.
Cherry picks the pagination feature from #685
See also #56
Usage
Simply create a paginator instance with a collection or array of items (like pages), and render the component. You will also likely need to find some way to pass the current page being rendered (if you're on pagination page 3, pass that to the constructor)
Screenshots
Verbose version:
Compact version: