Although pagination will help our restaurant critics to navigate through the records in consistent chunks, sometimes they will have a specific review in mind or will want to narrow down the display to a certain set of reviews. Adding search capabilities to our component will help the reviewers find specific reviews quickly. The changes that were made to the
all model for pagination will make adding the search feature a little easier.
The model will now need to keep track of the search term for multiple calls. Also, as the query will no longer be a static string, this should be cached as well. Add the following private variables to the
var $_total = null; var $_search = null; var $_query = null;
Next, the ...