Created
January 31, 2017 02:03
-
-
Save dzava/9819f2df19c1b4e1cc00973516bd5f11 to your computer and use it in GitHub Desktop.
Laravel bulma pagination
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()) | |
<nav class="pagination"> | |
<a href="{{ $paginator->previousPageUrl() }}" | |
class="pagination-previous {{ $paginator->onFirstPage() ? 'is-disabled': '' }}"> | |
Previous | |
</a> | |
<a href="{{ $paginator->nextPageUrl() }}" | |
class="pagination-next {{ !$paginator->hasMorePages() ? 'is-disabled': '' }}"> | |
Next | |
</a> | |
<ul class="pagination-list"> | |
@foreach ($elements as $element) | |
@if (is_string($element)) | |
<li><span class="pagination-ellipsis">…</span></li> | |
@endif | |
@if (is_array($element)) | |
@foreach ($element as $page => $url) | |
<li> | |
<a href="{{ $url }}" | |
class="pagination-link {{ $page == $paginator->currentPage() ? 'is-current' : '' }}"> | |
{{ $page }} | |
</a> | |
</li> | |
@endforeach | |
@endif | |
@endforeach | |
</ul> | |
</nav> | |
@endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is the $elements variable in this ?