PreviousPageURLWithKeys returns the URL for the previous page using custom query keys. Returns empty string if on page 1.
(baseURL, pageKey, limitKey string)
| 95 | // PreviousPageURLWithKeys returns the URL for the previous page using custom query keys. |
| 96 | // Returns empty string if on page 1. |
| 97 | func (p *PageInfo) PreviousPageURLWithKeys(baseURL, pageKey, limitKey string) string { |
| 98 | if p.Page > 1 { |
| 99 | return buildPaginationURL(baseURL, pageKey, utils.FormatInt(int64(p.Page-1)), limitKey, utils.FormatInt(int64(p.Limit))) |
| 100 | } |
| 101 | return "" |
| 102 | } |
| 103 | |
| 104 | // PreviousPageURL returns the URL for the previous page. |
| 105 | // Returns empty string if on page 1. |