I am trying to implement cakedc search plugin into my cakephp 2 application. I had the plugin working correctly at one point and something else in the application has knocked it off. However I would like to check that I am going about using the search pluging the right way as it could be the method I am using that is causing a conflict or something similar.
The search is only searching for one field which is order_id from the order model within the orders controller.
In my model I have :
// Search Filters
public $filterArgs = array(
array('name' => 'order_id', 'type' => 'like')
);
Within my controller I have:
public $presetVars = true;
public $components = array('Search.Prg', 'RequestHandler');
public $uses = array('order', 'product');
public function find () {
$this->Prg->commonProcess();
//debug($this->Order->parseCriteria($this->passedArgs));
$this->paginate = array('conditions' => $this->Order->parseCriteria($this->passedArgs));
$this->set('orders', $this->paginate());
}
EDIT this is happening because I am using the $uses variable in my class to define the controller models. Does anyone know how to define the cakedc search model. I have tried search, searchable and searchablebehavior
'order_id' => array('type' => 'like')for $filterArgs - my new dryer syntax. - markpublic $uses = array('Order', 'Product');. The first one will be your primary model here. - mark