Skip to content

Instantly share code, notes, and snippets.

@davidkryzaniak
Created February 7, 2014 20:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidkryzaniak/8871259 to your computer and use it in GitHub Desktop.
Save davidkryzaniak/8871259 to your computer and use it in GitHub Desktop.
<?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