How to loop pagination links using for loop instead of using foreach loop |
-
venance
Junior Member
-
Posts: 29
Threads: 9
Joined: Feb 2021
Reputation:
0
06-09-2022, 01:17 AM
(This post was last modified: 06-09-2022, 01:33 AM by venance.)
(06-09-2022, 12:11 AM)InsiteFX Wrote: getCurrentPageNumber()
This method returns the page number of the current page.
getPageCount()
This method returns total number of pages.
Yes exactly, the getCurrentPageNumber() return null | int, thus why I have to check if is greater than 0 be sure.
This help me when I want to use data attribute like data-page="1".
But, which way I can extend Pager class and add those methods instead of adding to the core so incase the system upgraded either with composer update, the library will not be affected.
(06-09-2022, 12:11 AM)InsiteFX Wrote: getCurrentPageNumber()
This method returns the page number of the current page.
getPageCount()
This method returns total number of pages.
Yes exactly, the getCurrentPageNumber() return null | int, thus why I have to check if is greater than 0 be sure.
This help me when I want to use data attribute like data-page="1".
But, which way I can extend Pager class and add those methods instead of adding to the core so incase the system upgraded either with composer update, the library will not be affected.
|
Messages In This Thread |
RE: How to loop pagination links using for loop instead of using foreach loop - by venance - 06-09-2022, 01:17 AM
|