php - Setup dynamic search in CakePHP -
i using search plugin cakephp.
i try dynamically setup $filterargs
array used filtering input user. reason why want because customers can create customer specific input fields. want make them filterable , searchable.
customer.php:
public function beforefind($querydata) { $this->filterargs['garantie'] = array( 'type' => 'subquery', 'method' => 'findcustomercustomfieldsbytext', 'field' => array('customer.id'), 'encode' => true ); }
debugging $filterargs
shows entry made:
array( 'garantie' => array( 'type' => 'subquery', 'method' => 'findcustomercustomfieldsbytext', 'field' => array( (int) 0 => 'customer.id' ), 'encode' => true ) )
unfortunately method findcustomercustomfieldsbytext()
not called.
it looks beforefind()
might not correct method call. callback-method should use can use dynamic creation of $filterargs
?
edit: question not identical linked question because callback methods prevent filter working.
Comments
Post a Comment