Welcome Guest, Not a member yet? Register   Sign In
How to loop pagination links using for loop instead of using foreach loop
#7

(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.
Reply


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



Theme © iAndrew 2016 - Forum software by © MyBB