I'm pretty new to CakePHP and was missing a crucial feature not generated开发者_运维问答 as scaffold: filtering.
What do I have to do to provide dropdowns or multi-selects on the index pages for each field that is a (foreign) key, thereby allowing to filter the table ("OR" inside multi-select, "AND" between different multi-selects, if any)?
From what my websearch has shown me there are many more people trying to accomplish the same thing, although I couldn't find anything that would work for me because either they have text fields and do wildcard filtering, or the plugins they propose only work for 1.2 whereas i now started with 1.3 etc. etc.
Can someone alleviate the confusion and maybe present some working code or direct me to the definitive guide[tm] where this matter has been solved?
Thx
It seems to me that scaffolding is provided as-is. If you find any helper accomplishing this, many would be interested, I'm sure. But scaffolding is not really meant satisfy such "complex" requirements, it just lists the row in the model. Although it shouldn't be difficult to program what you want: using cake from the console it can generate you all the code that scaffold does, you only have to add your filters.
I think you want this one. The author of the filter wrote:
Filters hasOne and belongsTo relationships (I prefer selects from dropdowns, but to each their own).
精彩评论