Created
May 4, 2017 06:44
-
-
Save Tairy/e1136f7016e7dd952d0fcb1e2b309f97 to your computer and use it in GitHub Desktop.
paginator
This file contains 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
<ul class="pagination pagination-sm no-margin pull-right"> | |
@if ($lastPage > 1) | |
@if ($currentPage > 1) | |
@for ($i = 1; $i <= $extremePagesLimit; $i++) | |
@if($i < $currentPage - $nearbyPagesLimit) | |
<li> | |
<a href="?page={{$i}}">{{$i}}</a> | |
</li> | |
@endif | |
@endfor | |
@if ($extremePagesLimit + 1 < $currentPage - $nearbyPagesLimit) | |
<li class="disabled"> | |
<span class="">...</span> | |
</li> | |
@endif | |
@for ($i = $currentPage - $nearbyPagesLimit; $i <= $currentPage - 1; $i++) | |
@if($i > 0) | |
<li> | |
<a href="?page={{$i}}">{{$i}}</a> | |
</li> | |
@endif | |
@endfor | |
@endif | |
<li class="active"> | |
<a href="javascript:;">{{ $currentPage }}</a> | |
</li> | |
@if($currentPage < $lastPage) | |
@for ($i = $currentPage + 1; $i <= $currentPage + $nearbyPagesLimit; $i++) | |
@if ($i < $lastPage) | |
<li> | |
<a href="?page={{$i}}">{{$i}}</a> | |
</li> | |
@endif | |
@endfor | |
@if ($lastPage - $extremePagesLimit > $currentPage + $nearbyPagesLimit) | |
<li class="disabled"> | |
<span class="">...</span> | |
</li> | |
@endif | |
@for ($i = $lastPage - $extremePagesLimit + 1; $i <= $lastPage; $i++) | |
@if($i > $currentPage + $nearbyPagesLimit) | |
<li> | |
<a href="?page={{$i}}">{{$i}}</a> | |
</li> | |
@endif | |
@endfor | |
@endif | |
@endif | |
</ul> |
Author
Tairy
commented
May 4, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment