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

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

问题描述

当我搜索我的列表我得到一些结果分页,但当我去第二页我的搜索是
打破,因为它是一个获取请求,我通过post获取搜索结果

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



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

解决方案

您希望实施 PRG模式


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


CakeDC搜索插件可在CakePHP中轻松完成。


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.

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 ?

解决方案

You want to implement the PRG Pattern.

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.

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

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

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