当前位置: 首页>>代码示例>>PHP>>正文


PHP PaginatedList::setPageLength方法代码示例

本文整理汇总了PHP中PaginatedList::setPageLength方法的典型用法代码示例。如果您正苦于以下问题:PHP PaginatedList::setPageLength方法的具体用法?PHP PaginatedList::setPageLength怎么用?PHP PaginatedList::setPageLength使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PaginatedList的用法示例。


在下文中一共展示了PaginatedList::setPageLength方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ModuleList

 /**
  * Show module list on page
  *
  * @return Array .
  */
 public function ModuleList()
 {
     $modules = ExtensionData::get()->filter(array('Type' => 'Module', 'Accepted' => '1'))->sort('Name');
     $paginatedList = new PaginatedList($modules, $this->request);
     $paginatedList->setPageLength(4);
     return $paginatedList;
 }
开发者ID:helpfulrobot,项目名称:vikas-srivastava-extensionmanager,代码行数:12,代码来源:ModuleHolderPage.php

示例2: PaginatedArticles

 public function PaginatedArticles()
 {
     $list = ArticlePage::get();
     $pages = new PaginatedList($list, $this->request);
     $pages->setPageLength(6);
     return $pages;
 }
开发者ID:4j5,项目名称:Helixnexus-Silverstripe,代码行数:7,代码来源:BarnLogPage.php

示例3: donators

 /**
  * Show the "login" page
  *
  * @return string Returns the "login" page as HTML code.
  */
 public function donators()
 {
     // Vorerst keine Seite erstellt
     $Members = new PaginatedList(self::members()->filter(array("Type" => 'donator')), $this->request);
     $Members->setPageLength(10);
     return $this->customise(new ArrayData(array("Members" => $Members, "SearchForm" => $this->SearchForm())))->renderWith(array('Find_donators', 'Find', $this->stat('template_main'), $this->stat('template')));
 }
开发者ID:andrelohmann,项目名称:roof-for-refugees.org,代码行数:12,代码来源:FindController.php

示例4: NewsItemsPaginated

 /**
  * Get items connected to this news holder paginated
  *
  * @param int $limit  Amount of items
  * @param int $per_page  Items per page
  */
 function NewsItemsPaginated($limit = 999, $per_page = 10)
 {
     $news = $this->NewsItems($limit);
     $items = new PaginatedList($news, $this->request);
     $items->setPageLength($per_page);
     return $items;
 }
开发者ID:helpfulrobot,项目名称:richardsjoqvist-silverstripe-news,代码行数:13,代码来源:NewsHolder.php

示例5: getPaginatedItems

 /**
  * @param string $type future, all, past
  * @return PaginatedList
  */
 public function getPaginatedItems()
 {
     $items = $this->getItems();
     $paginatedList = new PaginatedList($items, $this->request);
     $paginatedList->setPageLength($this->stat('page_length'));
     $paginatedList->setLimitItems(true);
     return $paginatedList;
 }
开发者ID:helpfulrobot,项目名称:wernerkrauss-silverstripe-casestudies,代码行数:12,代码来源:CaseStudyHolder.php

示例6: PaginatedPages

 public function PaginatedPages($num = 15)
 {
     $PaginatedPages = new PaginatedList($this->getCityHotels(), $this->request);
     $PaginatedPages->setPageLength($num);
     // Debug::show($PaginatedPages);
     // break;
     return $PaginatedPages;
 }
开发者ID:helpfulrobot,项目名称:maldicore-travelagent,代码行数:8,代码来源:CityHotelsListingPage.php

示例7: FilterByDate

 static function FilterByDate($class, $filter, $limit, $order)
 {
     $filter .= ' AND (CURDATE() >= FromDate AND (CURDATE() <= ToDate || ToDate IS NULL))';
     $entries = $class::get()->where($filter)->sort($order);
     $list = new PaginatedList($entries, Controller::curr()->request);
     $list->setPageLength($limit);
     return $list;
 }
开发者ID:helpfulrobot,项目名称:zirak-blog-post-publication-period,代码行数:8,代码来源:AdminPublicationPostDate.php

示例8: results

 protected function results($phrase = null)
 {
     $products = new DataList("Product");
     $products = $products->setDataQuery($this->query($phrase))->sort("Popularity", "DESC");
     $products = $this->getSorter()->sortList($products);
     $products = new PaginatedList($products, $this->request);
     $products->setPageLength(16);
     return $products;
 }
开发者ID:helpfulrobot,项目名称:burnbright-silverstripe-shop-productfinder,代码行数:9,代码来源:ProductFinder.php

示例9: PaginatedPages

 /**
  * @return PaginatedList
  */
 public function PaginatedPages()
 {
     // Protect against "Division by 0" error
     if ($this->Items == null || $this->Items == 0) {
         $this->Items = 1;
     }
     $pagination = new PaginatedList($this->AllChildren(), Controller::curr()->request);
     $pagination->setPageLength($this->Items);
     return $pagination;
 }
开发者ID:ormandroid,项目名称:ss_boilerplate,代码行数:13,代码来源:PortfolioHolder.php

示例10: requests

 /**
  * Show the "login" page
  *
  * @return string Returns the "login" page as HTML code.
  */
 public function requests()
 {
     // Vorerst keine Seite erstellt
     $Contacts = new PaginatedList(Member::currentUser()->OpenConfirmations(), $this->request);
     $Contacts->setPageLength(10);
     if ($Contacts->getTotalItems() == 0) {
         return $this->redirect('contacts/index');
     }
     return $this->customise(new ArrayData(array("Title" => _t('Contacts.REQUESTSTITLE', 'Contacts.REQUESTSTITLE'), "Contacts" => $Contacts)))->renderWith(array('Contacts_requests', 'Contacts', $this->stat('template_main'), $this->stat('template')));
 }
开发者ID:andrelohmann,项目名称:roof-for-refugees.org,代码行数:15,代码来源:ContactsController.php

示例11: getOrders

 public function getOrders($limit = 10)
 {
     if ($Member = Member::currentUser()) {
         $Orders = $Member->Orders()->sort('TransactionDate', 'DESC');
         $list = new PaginatedList($Orders, Controller::curr()->request);
         $list->setPageLength($limit);
         return $list;
     }
     return false;
 }
开发者ID:helpfulrobot,项目名称:dynamic-foxystripe,代码行数:10,代码来源:OrderHistoryPage.php

示例12: getNewsItems

 public function getNewsItems($pageSize = 10)
 {
     $items = DataObject::get('NewsPage', "ParentID = {$this->ID}")->sort('Date', 'DESC');
     $category = $this->getCategory();
     if ($category) {
         $items = $items->filter('CategoryID', $category->ID);
     }
     $list = new PaginatedList($items, $this->request);
     $list->setPageLength($pageSize);
     return $list;
 }
开发者ID:tractorcow,项目名称:silverstripe-express,代码行数:11,代码来源:NewsHolder.php

示例13: 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

示例14: chat

 /**
  * Show the "terms" page
  *
  * @return string Returns the "terms" page as HTML code.
  */
 public function chat()
 {
     if (!($o_Member = Member::currentUser()->Friend($this->urlParams['ID']))) {
         return $this->redirect('message/index');
     }
     // Update Many Many relation as read
     Member::currentUser()->Friends()->add($o_Member, array('UnreadMessage' => false));
     $Chat = new PaginatedList($o_Member->Messages(), $this->request);
     $Chat->setPageLength(10);
     return $this->customise(new ArrayData(array("ChatPartner" => sprintf(_t('Message.CHATPARTNER', 'Message.CHATPARTNER'), $o_Member->Nickname), "Chat" => $Chat, "MessageForm" => $this->MessageForm())))->renderWith(array('Message_chat', 'Message', $this->stat('template_main'), $this->stat('template')));
 }
开发者ID:andrelohmann,项目名称:roof-for-refugees.org,代码行数:16,代码来源:MessageController.php

示例15: PaginatedNews

 public function PaginatedNews()
 {
     if ($this->NewsExcerptsPerPage) {
         $NewsExcerptsPerPage = $this->NewsExcerptsPerPage;
     } else {
         $NewsExcerptsPerPage = '15';
     }
     $PaginatedNews = new PaginatedList($this->GetNewsPages(), $this->request);
     $PaginatedNews->setPageLength($NewsExcerptsPerPage);
     return $PaginatedNews;
 }
开发者ID:helpfulrobot,项目名称:andrewhoule-silverstripe-basicnews,代码行数:11,代码来源:NewsHolder.php


注:本文中的PaginatedList::setPageLength方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。