Php Laravel分页错误
我想用Laravel中的Lengshawarepaginator对数组进行分页 当我尝试在页面之间导航时,laravel显示以下错误:Php Laravel分页错误,php,laravel-5,pagination,laravel-pagination,Php,Laravel 5,Pagination,Laravel Pagination,我想用Laravel中的Lengshawarepaginator对数组进行分页 当我尝试在页面之间导航时,laravel显示以下错误: NotFoundHttpException in RouteCollection.php line 161 这是我的代码: //$queries1 is an array. $currentPage = LengthAwarePaginator::resolveCurrentPage(); $collection = new Collecti
NotFoundHttpException in RouteCollection.php line 161
这是我的代码:
//$queries1 is an array.
$currentPage = LengthAwarePaginator::resolveCurrentPage();
$collection = new Collection($queries1);
$currentPageSearchResults = $collection->slice($currentPage * 5, 5)->all();
$paginatedSearchResults= new LengthAwarePaginator($currentPageSearchResults, count($collection), 5);
//configure Path
$paginatedSearchResults->setPath(App::getLocale().'/activity/search_Activity');
return view(App::getLocale().'.activities.ActivityResults', ['results' => $paginatedSearchResults]);
如果我没有设置路径,分页的链接会自动重定向到“/”
会发生什么
谢谢你的帮助