GOT THIS ERROR在null CAK上调用成员函数parseCriteria()
`
CONTROLLER
class ProductsController extends AppController {
public $components = array('Search.Prg');
public function index() {
// start a standard search
$this->Prg->commonProcess();
// process the URL parameters
$params = $this->Prg->parsedParams();
// generate the Paginator conditions
$conditions = $this->Product->parseCriteria($params);
// add the conditions for paging
$this->Paginator->settings['conditions'] = $conditions;
$this->set('products', $this->Paginator->paginate());
}
}
MODEL
class Product extends AppModel {
public $actsAs = array('Search.Searchable');
public $filterArgs = array(
'product' => array(
'type' => 'like',
'field' => 'name'
)
);
}
查看
echo $this->Form->create();
echo $this->Form->input('product');
echo $this->Form->end(__('Search'));'