Created
June 28, 2019 07:31
-
-
Save nielspeen/1fd18776603ea8044652885932965a66 to your computer and use it in GitHub Desktop.
Laravel pagination template for Bulma (0.7.5).
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" role="navigation" aria-label="pagination"> | |
{{-- Previous Page Link --}} | |
@if ($paginator->onFirstPage()) | |
<a class="pagination-previous" disabled>@lang('Previous')</a> | |
@else | |
<a class="pagination-previous" href="{{ $paginator->previousPageUrl() }}">@lang('Previous')</a> | |
@endif | |
{{-- Next Page Link --}} | |
@if ($paginator->hasMorePages()) | |
<a class="pagination-next" href="{{ $paginator->nextPageUrl() }}">@lang('Next page')</a> | |
@else | |
<a class="pagination-next" disabled>@lang('Next page')</a> | |
@endif | |
<ul class="pagination-list"> | |
{{-- Pagination Elements --}} | |
@foreach ($elements as $element) | |
{{-- "Three Dots" Separator --}} | |
@if (is_string($element)) | |
<li><span class="pagination-ellipsis">{{$element}}</span></li> | |
@endif | |
{{-- Array Of Links --}} | |
@if (is_array($element)) | |
@foreach ($element as $page => $url) | |
@if ($page == $paginator->currentPage()) | |
<li><a class="pagination-link is-current" aria-label="Goto page {{ $page }}">{{ $page }}</a></li> | |
@else | |
<li><a class="pagination-link" href="{{ $url }}" aria-label="Goto page {{ $page }}">{{ $page }}</a></li> | |
@endif | |
@endforeach | |
@endif | |
@endforeach | |
</ul> | |
</nav> | |
@endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment