本文整理汇总了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);
}