开发者

Zend_Form filters rewrite or route - I want a readable URL

开发者 https://www.devze.com 2022-12-17 13:05 出处:网络
I have a form created with Zend_Form and I would like to setup a Route for the submission, so that instead of the user NOT seeing his URL change OR seeing the URL change to a complicated GET string, i

I have a form created with Zend_Form and I would like to setup a Route for the submission, so that instead of the user NOT seeing his URL change OR seeing the URL change to a complicated GET string, it will change to reflect the filters.

BAD: /products

BAD: /products?color=white&size=large

GOOD: /products/white/large

GOOD: /products/color/white/size/large

Is 开发者_StackOverflowthere any way to accomplish this?


Not directly via Zend_Form, because at the end Zend_Form draws a HTML Form, and the browser sends it encoded in a URL form.

What you need to do is catch the submit event via Javascript and manually create the URL you want and use window.location to transfer the form.

0

精彩评论

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

关注公众号