分页链接破坏来自发布数据 cakephp 的搜索结果 [英] Pagination links breaking search results coming from post data cakephp

查看:24
本文介绍了分页链接破坏来自发布数据 cakephp 的搜索结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我搜索我的列表时,我得到了一些分页结果,但是当我进入第二页时,我的搜索结果是中断,因为这是一个获取请求,我通过 post 方法获取搜索结果.

When I've Search my listing i'm getting some results with pagination, but when i go for second page my search is breaking as it was a get request where i'm getting the search results via post method.

注意:为了获取搜索结果,我不想通过 get 请求(即查询字符串参数)提交表单,也不想将表单数据存储在会话中

Note: For getting search results I don't want to submit the form via get request (i.e. Query string params) and also don't want to store the form data in session

有没有办法得到满足上述条件的结果?

Is there any way to get the results which satisfy the above conditions ?

推荐答案

您想要实施 PRG 模式.

Post/Redirect/Get (PRG) 是一种 Web 开发设计模式防止一些重复的表单提交,创建一个更直观的用户代理(用户)的接口.PRG 实现书签和以不会创建重复项的可预测方式刷新按钮表单提交.

Post/Redirect/Get (PRG) is a web development design pattern that prevents some duplicate form submissions, creating a more intuitive interface for user agents (users). PRG implements bookmarks and the refresh button in a predictable way that does not create duplicate form submissions.

CakeDC Search 插件让这在 CakePHP 中变得非常容易.

The CakeDC Search plugin makes that pretty easy to do in CakePHP.

这篇关于分页链接破坏来自发布数据 cakephp 的搜索结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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