我有一個laravel 5應用程序,其中我試圖對特定結果(結果數組而不是集合)進行分頁。 這是我的代碼:Laravel 5分頁鏈接
$paginator = new LengthAwarePaginator(
$l_aResponse['body'],
count($l_aResponse['body']),
'2',
Paginator::resolveCurrentPage(),
['path' => Paginator::resolveCurrentPath()]
);
return str_replace('/?', '?', $paginator->render());
我的問題是:是否有修改其中的「頁」參數中的URL頁面設置的方式呢? EG:我不想要這種格式:http://localsite/articles?page=3但我想要http://localsite/articles/3
我會感謝任何答案。謝謝!
這是在AbstractPaginator類的url()方法中硬編碼的。看看這裏,如果你渴望做到這一點:http://stackoverflow.com/a/22442404/3399676 – ClearBoth