Php 在null上调用成员函数parseCriteria()时出错
对null CAK上的成员函数Php 在null上调用成员函数parseCriteria()时出错,php,cakephp,Php,Cakephp,对null CAK上的成员函数parseCriteria()进行了此错误调用 ` 控制器 class ProductsController extends AppController { public $components = array('Search.Prg'); public function index() { // start a standard search $this->Prg->commonProcess()
parseCriteria()
进行了此错误调用
`
控制器
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());
}
}
模型
看法
可能的副本请参考此问题以获取可能的答案:
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'));'