如下所示:Custom pagination view in Laravel 5
$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
取代原来的:
{{1}}
但如何更换呢?
{{1}}
答案 0 :(得分:2)
Durp。
@include('pagination.default',['paginator'=&gt; $ users-&gt;追加(['sortBy'=&gt; $ sort,'order'=&gt; $ order])])
答案 1 :(得分:0)
最佳做法是:
$users->appends(Request::query())->links('Your custom pagination view name');
如果您想使用自定义参数而不是全部请求,则只需替换
'Request::query()' to ['sortBy' => $sort, 'order' => $order].