views:

213

answers:

3

So GET forms make the usual urls like

.../search/?q=apple

Can you make a form create urls like

.../search/q:apple/
+2  A: 

The methods to create these URL's can be found here: http://book.cakephp.org/view/842/url

+1  A: 

If I understand you correctly, you're not looking to create a different URI, per se, but rather to serialize the form data in a different way. In other words, you're interested in modifying the query string rather than the URI itself.

As far as I know, that's the way that forms serialize their data and there's no way to truly override this behavior. If you really want to do this, I suspect you'll have to capture the submit event, manually serialize the form data into the format you want, append that format to the form's action value, make a custom request to the page (via location.href, etc.) and return false so that the form itself never actually gets submitted.

Of course, you could also submit via Ajax where you have a little more control.

I'm not aware of any other way to do what I think you're asking.

Rob Wilkerson
A: 

Thanks, guys. I've found a different solution. I just submit the form as a POST and in the controller's action I read the post data and create a url with the post data as named params and then $this->redirect('...'); to it.

Temega