如何更改Paginator的页面名称? [英] How do you change the page name for Paginator?

查看:81
本文介绍了如何更改Paginator的页面名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前Paginator正在使用?page=N,但是我想使用其他东西.我该如何更改,以改为?sida=N?

Current Paginator is using ?page=N, but I want to use something else. How can I change so it's ?sida=N instead?

我已经看过Illuminate\Pagination\Environment,并且有一种方法(setPageName())可以对其进行更改(我认为),但是如何使用它?

I've looked at Illuminate\Pagination\Environment and there is a method (setPageName()) there to change it (I assume), but how do you use it?

Paginator类中,有一种方法可以更改Environment类中的基本url(setBaseUrl()),但是没有用于设置页面名称的方法.我真的需要扩展Paginator类仅仅是为了能够更改页面名称吗?

In the Paginator class there is a method the change the base url (setBaseUrl()) in the Environment class, but there is no method for setting a page name. Do I really need to extend the Paginator class just to be able to change the page name?

推荐答案

就像您说的那样,您可以使用setPageName方法:

Just like you said you can use the setPageName method:

Paginator::setPageName('sida');

您可以将其放置在app/start/global.php中.

这篇关于如何更改Paginator的页面名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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