I have this form below which contains two checkboxes to sort some products:
<form id="FiltreExtraForm" action="" method="post" name="FiltreExtraForm">
<input id="ProductsDeliveryPrice" type="checkbox" value="1" name="data[Products][delivery_price]"/>
<input id="ProductsPicture" type="checkbox" value="1" name="data[Products][picture]"/>
</form>
After POST I do the filtering but I also want to add received parameters to URL E.g: /products/index/delivery_price:1/picture:0 . Is this possible. How can I do that?
Note: I don't want to use GET to send form info.
Sounds like you are looking to do a Post/Redirect/Get.
Here are two examples of doing this in CakePHP:
The two main advantages of redirecting a
POST
to aGET
request are:If I understand you correctly (and I'm not sure that I do), you can pass additional variables on the query string of the form's action quite easily. Conventionally, that might look like this:
Using Cake, you should be able to do the same without the traditional query string if you'd rather (though the traditional method above will also work):
I would recommend looking at the form helper or at least constructing the action URI using helpers, but this should get you what you're after.
In the action to which you post, you could simply prepare the GET url and then redirect to this url. The action for that url then does the filtering.