over 9 years ago
Hello Guys,
We generally need paging in all the listing pages in website. To set paging in Zend Framework, please follow the below code::
// you need to set the below code in your controller
- $select = $db->select()->from('posts')->order('date_created DESC');
- $page=$this->_getParam('page',1);
- $pagining = Zend_Paginator::factory($select);
- $pagining->setItemCountPerPage(10);
- $pagining->setCurrentPageNumber($page);
- $this->view->reviewInformation = $pagining;
- $this->view->pagining = $pagining;
$select = $db->select()->from('posts')->order('date_created DESC'); $page=$this->_getParam('page',1); $pagining = Zend_Paginator::factory($select); $pagining->setItemCountPerPage(10); $pagining->setCurrentPageNumber($page); $this->view->reviewInformation = $pagining; $this->view->pagining = $pagining;
//On Html File
0 Comment(s)