Created
January 5, 2016 06:25
-
-
Save ankur13secret/314e1faaf916bd46782e to your computer and use it in GitHub Desktop.
Laravel Custom Pagination View
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
//Try Using | |
@include('pagination.default', ['paginator' => $value]) | |
//Use this way in your file to view | |
@if ($paginator->lastPage() > 1) | |
<ul class="pagination"> | |
<li class="{{ ($paginator->currentPage() == 1) ? ' disabled' : '' }}"> | |
<a href="{{ $paginator->url(1) }}">Previous</a> | |
</li> | |
@for ($i = 1; $i <= $paginator->lastPage(); $i++) | |
<li class="{{ ($paginator->currentPage() == $i) ? ' active' : '' }}"> | |
<a href="{{ $paginator->url($i) }}">{{ $i }}</a> | |
</li> | |
@endfor | |
<li class="{{ ($paginator->currentPage() == $paginator->lastPage()) ? ' disabled' : '' }}"> | |
<a href="{{ $paginator->url($paginator->currentPage()+1) }}" >Next</a> | |
</li> | |
</ul> | |
@endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment