0

GOT THIS ERROR Call to a member function parseCriteria() on null CAK `

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'
        )
    );
}

VIEW

echo $this->Form->create();

echo $this->Form->input('product');

echo $this->Form->end(__('Search'));'
NorthCat
  • 9,643
  • 16
  • 47
  • 50
gopu0000
  • 91
  • 1
  • 13
  • possible duplicate of [Call to a member function on a non-object](http://stackoverflow.com/questions/54566/call-to-a-member-function-on-a-non-object) – CBroe Feb 25 '15 at 08:03
  • please refer to this question for the possible answer : http://stackoverflow.com/questions/21455700/cakephp-error-call-to-a-member-function-parseaccept-on-a-non-object – Rajeev Ranjan Feb 25 '15 at 09:31

0 Answers0