Last active
July 23, 2021 09:04
-
-
Save Ichinya/d4a7948f6d23cc310fccb5f271374d8c to your computer and use it in GitHub Desktop.
pagination. При получаем пагинацию для страниц
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print_r(get_navigation(7, 2, 100, 3)); | |
Array | |
( | |
[start] => 1 | |
[previous_page] => 6 | |
[previous] => Array | |
( | |
[0] => 4 | |
[1] => 5 | |
[2] => 6 | |
) | |
[current] => 7 | |
[next] => Array | |
( | |
[0] => 8 | |
[1] => 9 | |
[2] => 10 | |
) | |
[next_page] => 8 | |
[end] => 50 | |
) | |
get_navigation(1, 10, 99, 3); | |
Array | |
( | |
[current] => 1 | |
[next] => Array | |
( | |
[0] => 2 | |
[1] => 3 | |
[2] => 4 | |
) | |
[next_page] => 2 | |
[end] => 10 | |
) | |
get_navigation(5, 10, 99, 1); | |
Array | |
( | |
[start] => 1 | |
[previous_page] => 4 | |
[previous] => Array | |
( | |
[0] => 4 | |
) | |
[current] => 5 | |
[next] => Array | |
( | |
[0] => 6 | |
) | |
[next_page] => 6 | |
[end] => 10 | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment