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


PHP PaginatedList类代码示例

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


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

示例1: PaginatedChildren

 public function PaginatedChildren($limit = 9)
 {
     $list = $this->Children();
     $pages = new PaginatedList($list, $this->getRequest());
     $pages->setpageLength($limit);
     return $pages;
 }
开发者ID:i-lateral,项目名称:silverstripe-childhubpage,代码行数:7,代码来源:ChildHubpage_Controller.php

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

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

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

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

示例6: handleList

 /**
  * Displays a list of all members on the site that belong to the selected
  * groups.
  *
  * @return string
  */
 public function handleList($request)
 {
     $fields = $this->parent->Fields()->filter('MemberListVisible', true);
     $members = $this->parent->Groups()->relation('Members');
     $members = new PaginatedList($members, $request);
     $list = new PaginatedList(new ArrayList(), $request);
     $list->setLimitItems(false);
     $list->setTotalItems($members->getTotalItems());
     foreach ($members as $member) {
         $cols = new ArrayList();
         $public = $member->getPublicFields();
         $link = $this->Link($member->ID);
         foreach ($fields as $field) {
             if ($field->PublicVisibility == 'MemberChoice' && !in_array($field->MemberField, $public)) {
                 $value = null;
             } else {
                 $value = $member->{$field->MemberField};
             }
             $cols->push(new ArrayData(array('Name' => $field->MemberField, 'Title' => $field->Title, 'Value' => $value, 'Sortable' => $member->hasDatabaseField($field->MemberField), 'Link' => $link)));
         }
         $list->push($member->customise(array('Fields' => $cols)));
     }
     $this->data()->Title = _t('MemberProfiles.MEMBERLIST', 'Member List');
     $this->data()->Parent = $this->parent;
     $controller = $this->customise(array('Members' => $list));
     return $controller->renderWith(array('MemberProfileViewer_list', 'MemberProfileViewer', 'Page'));
 }
开发者ID:helpfulrobot,项目名称:ajshort-silverstripe-memberprofiles,代码行数:33,代码来源:MemberProfileViewer.php

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

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

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

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

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

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

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

示例14: Events

 function Events()
 {
     $where = "StartDate >= CURRENT_DATE";
     $where .= " OR EndDate >= CURRENT_DATE";
     if (!$this->ManageAllEvents) {
         $filter = array("CalendarPageID" => $this->ID);
     }
     $entries = new PaginatedList(CalendarEntry::get()->filter($filter)->Sort('StartDate')->where($where), $this->request);
     $entries->setPageLength(4);
     return $entries;
 }
开发者ID:robomod,项目名称:silverstripe-calendar,代码行数:11,代码来源:CalendarPage.php

示例15: PaginatedHeatmapsList

 public function PaginatedHeatmapsList()
 {
     $member = Member::currentUser();
     $paginatedList = new PaginatedList(Heatmaps::get()->filter(array('MemberID' => $member->ID, 'Deleted' => 0))->sort('Created', 'DESC'), $this->request);
     if (isset($_GET['start'])) {
         if ($paginatedList->CurrentPage() > $paginatedList->TotalPages()) {
             $this->redirect($paginatedList->LastLink());
         }
     }
     return $paginatedList;
 }
开发者ID:hemant-chakka,项目名称:awss,代码行数:11,代码来源:ManageHeatmaps.php


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