I’m building a web application in CakePHP. I’m using the Paginator object to render a datagrid table with sorting options. However, the data I want feeding the table should be data returned from a search.
The app manages contract details. So app users should be able to search for contracts on fields such as client name, contact name etc.
Normally, if rolling my own solution, I’d use $_GET parameters to build the WHERE portion of a SQL statement. However, sorting a Paginator table in CakePHP seems to drop any query strings, and inserts URL segments like /field:value/foo:bar/ and so on.
What would be the normal route for building a search form? Any help would be much appreciated.
Take a look at the CakeDC Search plugin. It will handle params and stuff for you,