Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/280.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 5.2方法渲染不存在。_Php_Laravel 5.2 - Fatal编程技术网

Php 错误分页laravel 5.2方法渲染不存在。

Php 错误分页laravel 5.2方法渲染不存在。,php,laravel-5.2,Php,Laravel 5.2,我的控制器: $barang = App\Barang::paginate(10); return view('barang.index',compact('barang')); 我的看法是: {!! $barang->render() !!} 我得到一个错误: ErrorException in Macroable.php line 81: Method render does not exist. 有人能解决这个问题吗?您不能在视图文件中使用渲染功能。要生成url,您需要使用

我的控制器:

$barang = App\Barang::paginate(10);
return view('barang.index',compact('barang'));
我的看法是:

{!! $barang->render() !!} 
我得到一个错误:

ErrorException in Macroable.php line 81:
Method render does not exist. 

有人能解决这个问题吗?

您不能在视图文件中使用渲染功能。要生成url,您需要使用echo url('barang');这将创建合格的URL。请使用
{!!$barang->links()!!}
代替,请参阅文档-@Styphon仍然无法工作方法链接不存在。@Ezra请尝试
dd($barang)
以确保获得预期的结果。您不能在视图文件中使用呈现函数。要生成url,您需要使用echo url('barang');这将创建合格的URL。请改用
{!!$barang->links()!!}
查看文档-@Styphon仍然无法工作方法链接不存在。@Ezra请尝试
dd($barang)
以确保获得预期的结果。