手动分页错误-Laravel 5.0 [英] Manual Pagination Error - Laravel 5.0

查看:107
本文介绍了手动分页错误-Laravel 5.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在传递数组,count(array)itemsPerPage作为参数时出现以下错误. Call to undefined method Illuminate\Pagination\Paginator::make()

I am getting the following error while passing an array, count(array) and itemsPerPage as arguments. Call to undefined method Illuminate\Pagination\Paginator::make()

我尝试使用它,但是无法修复错误.

I tried following with it but cant fix the error.

use Illuminate\Pagination\LengthAwarePaginator as Paginator;
use Illuminate\Pagination;
use Illuminate\Support\Facades\Paginator;
use Illuminate\Pagination\Factory;
use App\Response;

make方法在 http://laravel.com中定义/api/5.0/Illuminate/Pagination/Environment.html#method_make 文档.

推荐答案

也许尝试删除这些行:

use Illuminate\Pagination\LengthAwarePaginator as Paginator;
use Illuminate\Support\Facades\Paginator;

然后添加此内容:

use Illuminate\Pagination\Paginator;

然后使用$paginator->render()代替make()

这篇关于手动分页错误-Laravel 5.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆