views:

36

answers:

1

I'm working on a PHP Real Estate catalog. I am working on the search part right now and I'm having trouble with the logic.

Should the default view show all items in the catalog or the search page? Should the code flow handle search first or individual view first?

Ideas, tips, links are appreciated. Thanks.

+1  A: 

It is best to use the SQL statement as the model for the search view; this way you can decouple the view from any processes. This would help to simplify the code flow too as well as regardless if you are searching or just displaying the generic view, the only things that change is the model (i.e, the SQL statement)

Extrakun
I've thought about that, but what could you please provide a basic example or link? Thanks a ton +1
Moshe