Filtering database results with checkboxes.

Hi, I’m working on a restaurant menu database application. The restaurant has almost a 1000 recipes that it cycles depending on what foods are in season (this is a vegetarian restaurant). Visitors to the site thus need to be able to drill down on various parameters, for example “vegan”, “dairy free”, “gluten-free”, “spicy”, “curry” etc.

I think the best way to do this is to allow the users to click on checkboxes and see the list of menu items changing. But I’m having a hard time finding similar examples in the Yii documentation and general Yii universe. Can anyone point me in the right direction?

I used the Yii blog taggin system as the basis for my database design where each menu item can be tagged with multiple attributes, for example "curry" and "spicy" and "gluten free". Not sure if this is the best way to implement a sensible design, any suggestions and pointers would be welcome.

It would be nice if the Yii documentation could include more "mini" examples. A lot the discussions has code but no UI to quickly see what functional features people are discussing. Am I missing something ? http://www.yiiframework.com/wiki/48/by-example-chtml/ and the Yii playground seem very short on examples.

Hi Peder,

You can do this defining your own business logic in controller file.

Create a New Action in controller file for write down your own queries with Yii standard code.Then you can do what ever you want.

If you need more specific solution then just show your code here. :)