Last active
August 29, 2015 14:15
-
-
Save devillom/0338aebb51e7f6f6f777 to your computer and use it in GitHub Desktop.
Custom Laravel 5 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
<!--view/post/lists--> | |
@include('pagination.uikit',['paginator'=>$posts]) | |
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
<!--view/pagination/uikit.blade.php--> | |
@if ($paginator->lastPage() > 1) | |
<div class="pagination"> | |
<ul class="uk-pagination"> | |
@if($paginator->currentPage() != 1) | |
<li><a href="{{ $paginator->url(1) }}" | |
class="item{{ ($paginator->currentPage() == 1) ? ' uk-disabled' : '' }}"> | |
<i class="icon left arrow"></i> ← Предыдущая </a> | |
</li> | |
@endif | |
@for ($i = 1; $i <= $paginator->lastPage(); $i++) | |
<li><a href="{{ $paginator->url($i) }}" | |
class="item{{ ($paginator->currentPage() == $i) ? ' uk-active' : '' }}">{{ $i }}</a></li> | |
@endfor | |
@if($paginator->currentPage() != $paginator->lastPage()) | |
<li><a href="{{ $paginator->url($paginator->currentPage()+1) }}" | |
class="item{{ ($paginator->currentPage() == $paginator->lastPage()) ? ' uk-disabled' : '' }}"> | |
Следующая → <i class="icon right arrow"></i></a></li> | |
@endif | |
</ul> | |
</div> | |
@endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment