Displaying paginated records can be great to allow your users to easily navigate through large sets of data. However, it is even better when you can give them the option to search directly.
In this recipe, we're going to add a new search box for our packages. We'll use a
LIKE condition in SQL to filter the resulting packages. This will do the trick for small datasets as a starting point.
For our recipe, we'll assume that you still have the
Package model, and
PackagesController, with the paginated
index() action with the
index.ctp view created from our previous recipe.
Perform the following steps:
app/View/Packages/right below the ...