change GET query string |
Another way to solve this, is assigning a default value to the fields. You probably let the user select the brand from a set of radiobuttons or a dropdown list. If no brand is selected, make the radiobutton "All brands" default (value "all"). Or in a dropdown list, set the default value to "all" with label "Select a brand...".
Now, when your form is transmitted, the get string has no empty options. In the controller, check if the value of brand == 'all'. If so, you don't need a where clause in your query builder for that option.
01-26-2017, 04:25 AM
(This post was last modified: 01-26-2017, 04:31 AM by ivantcholakov. Edit Reason: a correction ) Code: $query = array( |
Welcome Guest, Not a member yet? Register Sign In |