views:

79

answers:

1

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 there any way to accomplish this?

A: 

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.

Chris
Don't forget to fail over to "bad" mode if javascript is disabled in the user's browser.
Billy ONeal
In that case it will get submitted as url encoded params, and Zend can work ecually fine with those.
Chris