当前位置: 首页>>代码示例>>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;未经允许,请勿转载。