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


PHP PaginatedList::setPaginationGetVar方法代碼示例

本文整理匯總了PHP中PaginatedList::setPaginationGetVar方法的典型用法代碼示例。如果您正苦於以下問題:PHP PaginatedList::setPaginationGetVar方法的具體用法?PHP PaginatedList::setPaginationGetVar怎麽用?PHP PaginatedList::setPaginationGetVar使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PaginatedList的用法示例。


在下文中一共展示了PaginatedList::setPaginationGetVar方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: Comments

 /**
  * Returns a list of all the comments attached to this record.
  *
  * @return PaginatedList
  */
 public function Comments()
 {
     $order = Commenting::get_config_value($this->ownerBaseClass, 'order_comments_by');
     $list = new PaginatedList(Comment::get()->where(sprintf("ParentID = '%s' AND BaseClass = '%s'", $this->owner->ID, $this->ownerBaseClass))->sort($order));
     $list->setPageLength(Commenting::get_config_value($this->ownerBaseClass, 'comments_per_page'));
     $controller = Controller::curr();
     $list->setPageStart($controller->request->getVar("commentsstart" . $this->owner->ID));
     $list->setPaginationGetVar("commentsstart" . $this->owner->ID);
     $list->MoreThanOnePage();
     return $list;
 }
開發者ID:roed,項目名稱:silverstripe-comments,代碼行數:16,代碼來源:CommentsExtension.php

示例2: getViewableChildren

 /**
  * All viewable product groups of this group.
  *
  * @param int $numberOfProductGroups Number of product groups to display
  * 
  * @return PaginatedList
  * 
  * @author Sebastian Diel <sdiel@pixeltricks.de>, Ramon Kupper <rkupper@pixeltricks.de>
  * @since 04.01.2014
  */
 public function getViewableChildren($numberOfProductGroups = false)
 {
     if ($this->viewableChildren === null) {
         $viewableChildren = new ArrayList();
         foreach ($this->Children() as $child) {
             if ($child->hasProductsOrChildren()) {
                 $viewableChildren->push($child);
             }
         }
         if ($viewableChildren->count() > 0) {
             if ($numberOfProductGroups == false) {
                 if ($this->productGroupsPerPage) {
                     $pageLength = $this->productGroupsPerPage;
                 } else {
                     $pageLength = SilvercartConfig::ProductGroupsPerPage();
                 }
             } else {
                 $pageLength = $numberOfProductGroups;
             }
             $pageStart = $this->getSqlOffsetForProductGroups($numberOfProductGroups);
             $viewableChildrenPage = new PaginatedList($viewableChildren, $this->getRequest());
             $viewableChildrenPage->setPaginationGetVar('groupStart');
             $viewableChildrenPage->setPageStart($pageStart);
             $viewableChildrenPage->setPageLength($pageLength);
             $this->viewableChildren = $viewableChildrenPage;
         } else {
             return false;
         }
     }
     return $this->viewableChildren;
 }
開發者ID:silvercart,項目名稱:silvercart,代碼行數:41,代碼來源:SilvercartProductGroupPage.php

示例3: PagedReplies

 /**
  * Returns the list of replies paged, with spam and unmoderated items excluded, for use in the frontend
  *
  * @return PaginatedList
  */
 public function PagedReplies()
 {
     $list = $this->Replies();
     // Add pagination
     $list = new PaginatedList($list, Controller::curr()->getRequest());
     $list->setPaginationGetVar('repliesstart' . $this->ID);
     $list->setPageLength($this->getOption('comments_per_page'));
     $this->extend('updatePagedReplies', $list);
     return $list;
 }
開發者ID:bhavesh1212310,項目名稱:silverstripe-comments,代碼行數:15,代碼來源:Comment.php


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