So far, so good. Now that our overall program design has been created, we’re ready to start narrowing things down and we will start by thinking about our helper Search class. There is a variety of things this class will need to do, but for part two of this article we are only concerned with displaying a proper set of search form fields.
We will need a function within our Search class to display appropriate form field objects for each of the items by which we wish to search. Let’s call this function “get_search_field”, and as a parameter let’s pass it the name of the field for which we wish to create an input field.