I'm having problems with paging with form lookup in Zend Framework 1.
There is a method in the model that does a query with where to bring the result according to the research done, and pagination if done without session only works the first page, since the other does not bring the results as filter. >
After days searching and still no solution, I saw that I can actually try to use the session to try to fix this problem, but I do not understand how to apply it.
I have the following controller:
public function consultarAction()
{
$setor = $this->_getParam('setor');
$modLotacao = new Sca_Model_Lotacao('sca');
$resultado = $modLotacao->getConsultaTelefones($setor);
$busca = new Zend_Session_Namespace($resultado);
if ($this->_request->isPost()) {
$busca->unsetAll();
$busca->busca = $this->_request->getPost();
}
$paginator = Zend_Paginator::factory($resultado($busca->busca));
$paginator->setItemCountPerPage(5);
$paginator->setPageRange(7);
$paginator->setCurrentPageNumber(intval($this->_request->getParam('pagina', 1)));
$this->view->paginator = $paginator;
}
This is returning me error, but really should something is wrong that I do not know = \
Anyway, could anyone help me?