I have a system to allow the visitor browse products by listing, sorting and filtering it.
I want my url look like this "/category/smartphones/samsung/android/.../" when the visitors filters by selection “brand”, “operting system type”, “cpu”, … so every things they’re filtering, url will change like :
filter by brand : /category/smartphones/samsung/
by os type : /category/smartphones/android/
by brand and os type : /category/smartphones/samsung/android/
...
also, visitors can sort while they’re filtering or they can filter while they’re sorting. so the url can be more like "/category/smartphones/samsung/android/sort:created/direction:desc/"
I don’t know cakephp can do something like that or not because I’m beginner in this framework. or any solution with something like that?
I just done with sorting configuration in router. but I don’t know how to start with something like that (filters is unlimited parameters).
It’s actually quite easy, and you don’t even need an entry in the routes file if you’re happy with Cake’s default routing method. 🙂
This is what I did…
Then I called…
http://localhost/pages/test/x/y/z/something:x/else:y/1/2/3It output this…
So you simply use
$this->params['named']and$this->params['pass']to get the terms you need. Hope that helps!