本文整理匯總了PHP中Pagerfanta\Pagerfanta::haveToPaginate方法的典型用法代碼示例。如果您正苦於以下問題:PHP Pagerfanta::haveToPaginate方法的具體用法?PHP Pagerfanta::haveToPaginate怎麽用?PHP Pagerfanta::haveToPaginate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Pagerfanta\Pagerfanta
的用法示例。
在下文中一共展示了Pagerfanta::haveToPaginate方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: createRepresentationFromPagerfanta
public function createRepresentationFromPagerfanta(Pagerfanta $pager)
{
$this->pager = empty($pager) ? $this->pager : $pager;
if (empty($this->pager)) {
return array();
}
$representation = array('hasToPaginate' => $this->pager->haveToPaginate(), 'hasNextPage' => $this->pager->hasNextPage(), 'hasPreviousPage' => $this->pager->hasPreviousPage(), 'totalItems' => $this->pager->getNbResults(), 'itemsPerPage' => $this->pager->getMaxPerPage(), 'currentPage' => $this->pager->getCurrentPage(), 'data' => $this->pager->getCurrentPageResults());
return $representation;
}
示例2: haveToPaginate
/**
* @return boolean
*/
public function haveToPaginate()
{
return $this->pagerfanta->haveToPaginate();
}
示例3: testHaveToPaginateReturnsFalseWhenTheNumberOfResultsIsLessThanMaxPerPage
public function testHaveToPaginateReturnsFalseWhenTheNumberOfResultsIsLessThanMaxPerPage()
{
$this->setAdapterNbResultsAny(100);
$this->pagerfanta->setMaxPerPage(101);
$this->assertFalse($this->pagerfanta->haveToPaginate());
}