本文整理汇总了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;
}
示例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;
}
示例3: PaginatedArticles
public function PaginatedArticles()
{
$list = ArticlePage::get();
$pages = new PaginatedList($list, $this->request);
$pages->setPageLength(6);
return $pages;
}
示例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')));
}
示例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;
}
示例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'));
}
示例7: PaginatedPages
public function PaginatedPages($num = 15)
{
$PaginatedPages = new PaginatedList($this->getCityHotels(), $this->request);
$PaginatedPages->setPageLength($num);
// Debug::show($PaginatedPages);
// break;
return $PaginatedPages;
}
示例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;
}
示例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;
}
示例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;
}
示例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')));
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}