In cakephp4 i am looking for a search function plugin so i can add parameters.
Previously i was using code like this for such a search and i am looking for a plugin
if (isset($this->request->data['search'])) {
$filter_url['controller'] = $this->request->params['controller'];
$filter_url['action'] = $this->request->params['action'];
$filter_url['page'] = 1;
// for each filter we will add a GET parameter for the generated url
foreach($this->request->data as $name => $value){
//need to add this to ignore the checkbox returned whcih should not appear on address bar as a search option
if($value){
$filter_url[$name] = urlencode($value);
// debug($value);
}
}
//Post params are now GET paramaters
return $this->redirect($filter_url);
}//if isset
} // if post
foreach($this->request->query as $param_name => $value):
if ($param_name=='lastname') $searchLastName =$value;
if ($param_name=='firstname') $searchFirstName =$value;
if ($param_name=='startDate') $searchDate =$value;
if ($param_name=='endDate') $searchDate2 =$value;
if ($param_name=='xeroDate') $searchDate3 =$value;
if ($param_name=='subject') $searchSubject =$value;
if ($param_name=='state') $searchState =$value;
endforeach;