O'Reilly logo

Learning Joomla! 1.5 Extension Development by Joseph L. LeBlanc

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Searching

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.

Adjusting the model

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 all model:

var $_total = null;
var $_search = null;
var $_query = null;

Next, the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required