Created
February 7, 2014 20:36
-
-
Save davidkryzaniak/8871259 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$db = Zend_Db_Table::getDefaultAdapter(); | |
$adapter = new Zend_Paginator_Adapter_DbSelect( | |
$db->select() | |
->from('readings') | |
->where("verified = 'p'") | |
); | |
$rowCount = $db->fetchRow("SELECT COUNT(*) AS total FROM readings WHERE verified = 'p'"); | |
$adapter->setRowCount( | |
(int) $rowCount["total"] | |
); | |
$this->view->paginator = new Zend_Paginator($adapter); | |
$this->view->paginator->setCurrentPageNumber($this->_getParam('page')); | |
$this->view->paginator->setItemCountPerPage(6); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment