我有一个系统允许访问者通过列出、排序和过滤来浏览产品。
当访问者通过选择“品牌”、“操作系统类型”、“cpu”等进行过滤时,我希望我的 url 看起来像这样"/category/smartphones/samsung/android/.../"
,所以他们过滤的每一件事,url 都会改变如下:
filter by brand : /category/smartphones/samsung/
by os type : /category/smartphones/android/
by brand and os type : /category/smartphones/samsung/android/
...
此外,访问者可以在筛选时进行排序,也可以在排序时进行筛选。所以网址可以更像"/category/smartphones/samsung/android/sort:created/direction:desc/"
我不知道 cakephp 能不能做这样的事情,因为我是这个框架的初学者。或任何类似的解决方案?
我刚刚完成了路由器中的排序配置。但我不知道如何从这样的事情开始(过滤器是无限参数)。