當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Paginator::_createPages方法代碼示例

本文整理匯總了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);
 }
開發者ID:richhl,項目名稱:kalturaCE,代碼行數:26,代碼來源:Paginator.php


注:本文中的Zend_Paginator::_createPages方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。