public function userAction() {
$form = new Application_Form_Search();
if ($this->getRequest()->isGet() && $this->getRequest()->getQuery()) {
$user = new Application_Model_DbTable_User();
$formData = $this->getRequest()->getQuery();
if ($form->isValid($formData)) {
$query = $this->getRequest()->getParam('search');
$select = $user->select();
$select->where('username = ? OR email = ? OR first_name = ? OR last_name = ?', $query);
$rows = $user->fetchAll($select);
if ($rows->count()) {
$paginator = Zend_Paginator::factory($select);
$paginator->setItemCountPerPage(1); // кол-во елементов на стр, надо бы в конфиг или в константу выкинуть
$paginator->setCurrentPageNumber($this->_getParam('page', 1));
$this->view->paginator = $paginator;
$this->view->searchResultCnt = $rows->count();
$this->view->searchResultMsg = "По запросу '{$query}' найдено {$rows->count()} полей";
$this->view->query = $query;
} else {
$this->view->notFoundMsg = "По запросу '{$query}' ничего не найдено";
}
}
}
$this->view->form = $form;
}
Само оформление пагинатора взято отсюда: http://framework.zend.com/manual/1.12/en/z...xample-controls
В Bootstrap.php добавлена такая строка: Zend_View_Helper_PaginationControl::setDefaultViewPartial('controls.phtml');
В view для вывода пагинатора: echo $this->paginationControl($this->paginator, 'Elastic', 'controls.phtml');
_____________
...think about your actions.