如图所示:Custom pagination view in Laravel 5
@include('pagination.default', ['paginator' => $users])
替换原来的:
$users->render();
但如何取代它呢?
$users->appends(['sortBy' => $sort, 'order' => $order])->render()
@if ($paginator->lastPage() > 1)
<ul class="pagination">
<li class="{{ ($paginator->currentPage() == 1) ? ' disabled' : '' }}">
<a href="{{ $paginator->url(1) }}">Previous</a>
</li>
@for ($i = 1; $i <= $paginator->lastPage(); $i++)
<li class="{{ ($paginator->currentPage() == $i) ? ' active' : '' }}">
<a href="{{ $paginator->url($i) }}">{{ $i }}</a>
</li>
@endfor
<li class="{{ ($paginator->currentPage() == $paginator->lastPage()) ? ' disabled' : '' }}">
<a href="{{ $paginator->url($paginator->currentPage()+1) }}" >Next</a>
</li>
</ul>
@endif
2条答案
按热度按时间enyaitl31#
杜普
pn9klfpd2#
最佳做法是:
如果您希望使用自定义参数而不是all请求,则只需替换