Created
April 21, 2017 12:57
-
-
Save themsaid/163a080c02a42ea8e4cf80a272ff3329 to your computer and use it in GitHub Desktop.
Pagination view for UIkit
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
@if ($paginator->hasPages()) | |
<ul class="uk-pagination"> | |
@if ($paginator->onFirstPage()) | |
<li class="uk-disabled"><a href="#"><span uk-pagination-previous></span></a></li> | |
@else | |
<li><a href="{{ $paginator->previousPageUrl() }}"><span uk-pagination-previous></span></a></li> | |
@endif | |
{{-- Pagination Elements --}} | |
@foreach ($elements as $element) | |
{{-- "Three Dots" Separator --}} | |
@if (is_string($element)) | |
<li class="uk-disabled"><span>...</span></li> | |
@endif | |
{{-- Array Of Links --}} | |
@if (is_array($element)) | |
@foreach ($element as $page => $url) | |
@if ($page == $paginator->currentPage()) | |
<li class="uk-active"><span>{{ $page }}</span></li> | |
@else | |
<li><a href="{{ $url }}">{{ $page }}</a></li> | |
@endif | |
@endforeach | |
@endif | |
@endforeach | |
{{-- Next Page Link --}} | |
@if ($paginator->hasMorePages()) | |
<li><a href="{{ $paginator->nextPageUrl() }}"><span uk-pagination-next></span></a></li> | |
@else | |
<li class="uk-disabled"><a href="#"><span uk-pagination-next></span></a></li> | |
@endif | |
</ul> | |
@endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for you <3