php - Dynamically create the $filterArgs array in CakePHP -
is possible dynamically create $filterargs
array in cakephp when using search plugin?
my customers able create own input fields (customer specific) , want make of them searchable. have map them in $filterargs
array.
e.g.:
public $filterargs = array( 'input_filter' => array( 'type' => 'subquery', 'method' => 'findcustomercustomfieldsbytext', 'field' => 'customer.id', 'encode' => true ) );
just add them conditionally need filterargs array.
if ($somefieldispresentcheckhere) { $this->model->filterargs['something'] = [ /* settings go here */ ]; }
Comments
Post a Comment