Это то, что я сделал :
Модель:
Код: Выделить всё
class Post extends AppModel {
var $name = 'Post';
var $displayField = 'title';
public $filterArgs = array(
array('name' => 'title','type' => 'string'),
);
}
Код: Выделить всё
class PostsController extends AppController {
var $name = 'Posts';
public $components = array('Search.Prg');
public $presetVars = array(
array('field' => 'title', 'type' => 'value'),
);
function beforeFilter() {
parent::beforeFilter();
}
public function index() {
$this->Prg->commonProcess();
$this->paginate = array(
'conditions' => $this->Post->parseCriteria($this->passedArgs));
$this->paginate = array('limit' => 15);
$this->set('posts', $this->paginate());
}
}
Код: Выделить всё
Подробнее здесь: https://stackoverflow.com/questions/602 ... rch-plugin