本文整理汇总了PHP中PaginatedList::MoreThanOnePage方法的典型用法代码示例。如果您正苦于以下问题:PHP PaginatedList::MoreThanOnePage方法的具体用法?PHP PaginatedList::MoreThanOnePage怎么用?PHP PaginatedList::MoreThanOnePage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PaginatedList
的用法示例。
在下文中一共展示了PaginatedList::MoreThanOnePage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: testMoreThanOnePage
public function testMoreThanOnePage()
{
$list = new PaginatedList(new ArrayList());
$list->setPageLength(1);
$list->setTotalItems(1);
$this->assertFalse($list->MoreThanOnePage());
$list->setTotalItems(2);
$this->assertTrue($list->MoreThanOnePage());
// Disable paging
$list->setPageLength(0);
$this->assertFalse($list->MoreThanOnePage());
}