Search a file size range in CGridView
search, file size, range, size range filter, CGridView
Working on a report system of files transfert, I had to let the users simply find files by size. I didn't want to have two fields, I prefer a simple text input, with "human syntax".
To be able to add file size range searching functionality to your advanced search forms (not grid view filters) without having to add public attributes, 'safe' rules, and chunky search conditions for each
1. Create an Active Record Behavior that builds the criteria for the search() method and attach it to your model
2. Modify the search() method of the model to merge the behavior's criteria in with the rest of the searchable attributes