I'm using Perch, which is a php CMS. I'm asking this question here, as it seems like a general php question.
Basically, I'm using filter on a search page:
perch_content_custom('Jobs', array(
'page'=>'/view-job.php',
'template'=>'_job_list.html',
'filter' => array(
array(
'filter'=>'job_subject',
'match'=>'eq',
'value'=> $_GET['subject']
),
array(
'filter'=>'job_term',
'match'=>'eq',
'value'=> $_GET['term']
),
)
));
I only want to filter if the GET string has a value, - so if job_subject is specified, apply a filter - but I know I can't use an IF statement and I'm not sure of the alternative in php?