简体   繁体   English

Laravel 4:分页总是返回null

[英]Laravel 4: Pagination always returning null

According to the Laravel 4 paginations docs page , this should be providing me with pagination. 根据Laravel 4分页文档页面 ,这应该为我提供分页。

I have 3 returned results for this query: 我为此查询返回了3个结果:

$florist = Florist::all();

I paginate it: 我对它进行分页:

$florist = Florist::paginate(1);

And in my view I have added: 在我看来,我添加了:

{{ $florist->links }}

Yet nothing is displayed. 但是什么也没有显示。 If I do a var_dump of $florist->links it always returns null . 如果我执行$florist->linksvar_dump ,则始终返回null Changing the pagination number in the query makes no difference. 在查询中更改分页号没有区别。

Any ideas? 有任何想法吗?

Thanks for your help. 谢谢你的帮助。

links is not a property but a method. links不是属性而是方法。 To print out the links you need to call that method. 要打印出链接,您需要调用该方法。

{{ $florist->links() }}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM