本文整理匯總了PHP中Zend_Paginator::_createPages方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Paginator::_createPages方法的具體用法?PHP Zend_Paginator::_createPages怎麽用?PHP Zend_Paginator::_createPages使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend_Paginator
的用法示例。
在下文中一共展示了Zend_Paginator::_createPages方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _createPages
/**
* Creates the page collection.
*
* @param string $scrollingStyle Scrolling style
* @return stdClass
*/
protected function _createPages($scrollingStyle = null)
{
$this->getCurrentItems();
// after loading the items, we can call the adapter to get the total count
$this->_pageCount = $this->_calculatePageCount();
/*
* reproduce the original paginator behavior, for example:
* if we have a total of 2 pages, but the user requested page number 3, the original paginator will return the last page (number 2).
*
* this is needed bacause the previous request for getCurrentItems was made when we didn't know the total pages count.
* when page number is not normalized, we should get the items again.
*/
$normalizedPageNumber = $this->normalizePageNumber($this->_currentPageNumber);
if ($normalizedPageNumber != $this->_currentPageNumber) {
$this->_currentItems = null;
$this->getCurrentItems();
$this->_pageCount = $this->_calculatePageCount();
}
return parent::_createPages($scrollingStyle);
}