重定向分页器 -> 排序到 Cakephp 中的第一页
如何进行分页器排序并指定它转到第一页:
echo $paginator->sort('Make', 'Car.make');
如果您在第 6 页并且想要按汽车品牌对列表进行排序。它会对列表进行排序,但会将您置于已排序列表的第 6 页。当有人点击“make”按钮排序时,我希望分页器将他们带到排序的第 1 页。我知道有一个 options['url']['page'] 变量,并且排序函数可以是 'sort($title, $key = NULL, $options = array())'。但是,我不知道在上面的 $paginator->sort 语句中设置该标志的正确语法是什么。请帮忙,谢谢!
How do I do a paginator sort and also specify it to go to the first page:
echo $paginator->sort('Make', 'Car.make');
If you're on page 6 and want to sort the list by car make. It sorts the list but puts you on page 6 of the sorted list. When someone clicks on the sort by "make" button, I want the paginator to take them to page 1 of the sort. I know there is an options['url']['page'] variable and that the sort function can be 'sort($title, $key = NULL, $options = array())'. However, I have no idea what the proper syntax is for setting that flag in the $paginator->sort statement above. Please help, thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
深入研究 PaginatorHelper API 一点,这应该可以工作:
不过还没有测试过。
Digging through the PaginatorHelper API a bit, this should work:
Haven't tested it though.