开发者

Cakephp hide field names when sorting pagination

开发者 https://www.devze.com 2023-02-09 07:11 出处:网络
In cakephp, when sorting a paginated list, the field names are displayed in the url. For security, is there a way to hide the field names, or change the url somehow while keep开发者_开发技巧ing the so

In cakephp, when sorting a paginated list, the field names are displayed in the url. For security, is there a way to hide the field names, or change the url somehow while keep开发者_开发技巧ing the sort?

For example: http://.../page:1/sort:Item.item_name/direction:asc

How can we change or hide Item.item_name while keeping the sort? Thanks very much.


you would have to write your own pagination helper that builds out a form and not links, then you can use POST to send the data. the form fields would still be in the html form though so no different to links.

Imo there is no point to hiding the field names, as this does not fix any security holes. people can still see the fields according to the forms as it is like data[ModelName][field_name].

doing it for the 'nice urls' fact is maybe a better reason, but then if that was the case people would not have invented the PRG pattern... http://en.wikipedia.org/wiki/Post/Redirect/Get

doing that means that search engines would have a hard time indexing your site.

0

精彩评论

暂无评论...
验证码 换一张
取 消