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