本文整理汇总了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;
}
示例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;
}
示例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;
}