Моя проблема в том, что когда я ищу со страницы: 2, этого вообще не происходит.
вот мой код:
Модель клиента
Код: Выделить всё
public $actsAs = array('Search.Searchable');
public $filterArgs = array(
'searchTerm' => array(
'type' => 'like',
'field' => array('Customer.name', 'Customer.mobile', 'Customer.address'),
'filter' => array('type' => 'query', 'method' => 'orConditions')
)
);
public function orConditions($data = array()) {
$filter = $data['filter'];
$cond = array(
'OR' => array(
'Customer.name LIKE' => '%' . $filter . '%',
'Customer.mobile LIKE' => '%' . $filter . '%',
'Customer.address LIKE' => '%' . $filter . '%',
));
return $cond;
}
Код: Выделить всё
public $components = array('Paginator', 'Session', 'Search.Prg');
public $presetVars = true;
public function index() {
$this->Prg->commonProcess();
$this->paginate = array();
$conditions = $this->Customer->parseCriteria($this->passedArgs);
$this->Customer->recursive = 0;
$this->paginate = array(
'limit' => 5,
);
$this->set('customers', $this->paginate($this->modelClass, $conditions));
$this->set('model', $this->modelClass);
}
Код: Выделить всё
Ошибка: запрошенный адрес '/KPautos/products/index/page:2?searchTerm=j' не найден на этом сервере.
Поиск не работает на странице:2...
Любое помощь будет от всей души признательна... Заранее спасибо
Подробнее здесь: https://stackoverflow.com/questions/260 ... rch-plugin