Laravel 5 中的自定义分页视图

Custom pagination view in Laravel 5(Laravel 5 中的自定义分页视图)
本文介绍了Laravel 5 中的自定义分页视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Laravel 4.2 可以选择在 app/config/view.php 中指定自定义视图,例如:

Laravel 4.2 has the option to specify a custom view in app/config/view.php such as:

/*
|--------------------------------------------------------------------------
| Pagination View
|--------------------------------------------------------------------------
|
| This view will be used to render the pagination link output, and can
| be easily customized here to show any view you like. A clean view
| compatible with Twitter's Bootstrap is given to you by default.
|
*/
'pagination' => 'pagination_slider-alt'

这在 Laravel 5 中消失了,至少在 view.php 方面是这样.

This is gone in Laravel 5 at least regarding view.php.

有没有办法在 Laravel 5 中复制这种行为?

Is there a way to replicate this behavior in Laravel 5?

推荐答案

而在 Laravel 4.2 中我会使用:

{{ $users->links('view.name') }}

Laravel 5 中,您可以使用以下内容复制上述内容:

In Laravel 5 you can replicate the above with the following:

@include('view.name', ['object' => $users])

现在在包含的视图中,$object 将有可​​用的分页方法,例如 currentPage()lastPage()perPage()

Now in the included view, $object will have the pagination methods available, such as currentPage(), lastPage(), perPage(), etc.

您可以在 http://laravel.com/docs/5.0/pagination

这篇关于Laravel 5 中的自定义分页视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Convert JSON integers and floats to strings(将JSON整数和浮点数转换为字符串)
in php how do I use preg replace to turn a url into a tinyurl(在php中,如何使用preg替换将URL转换为TinyURL)
all day appointment for ics calendar file wont work(ICS日历文件的全天约会不起作用)
trim function is giving unexpected values php(Trim函数提供了意外的值php)
Basic PDO connection to MySQL(到MySQL的基本PDO连接)
PHP number_format returns 1.00(Php number_Format返回1.00)