Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/288.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Laravel分页错误_Php_Laravel 5_Pagination_Laravel Pagination - Fatal编程技术网

Php 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

我想用Laravel中的Lengshawarepaginator对数组进行分页

当我尝试在页面之间导航时,laravel显示以下错误:

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]);
如果我没有设置路径,分页的链接会自动重定向到“/”

会发生什么

谢谢你的帮助