php artisan vendor:publish --tag=laravel-pagination
resources/views/vendor/pagination/default.blade.php
@if ($paginator->hasPages())
{{-- Previous Page Link --}}
@if ($paginator->onFirstPage())
«@else
«@endif
{{-- Pagination Elements --}}
@foreach ($elements as $element)
{{-- "Three Dots" Separator --}}
@if (is_string($element))
{{ $element }}@endif
{{-- Array Of Links --}}
@if (is_array($element))
@foreach ($element as $page => $url)
@if ($page == $paginator->currentPage())
{{ $page }}@else
{{ $page }}@endif
@endforeach
@endif
@endforeach
{{-- Next Page Link --}}
@if ($paginator->hasMorePages())
»@else
»@endif
第
页
跳转
function goToPage() {
var page = $('#pageNum').val();
var total = $('#pageNum').data('total');
var url = $('#pageNum').data('url');
url = url.substring(0, url.length-1);
if (page < 1) {
page = 1;
}
if (page > total) {
page = total;
}
window.location.href = url + page;
}
@endif