本文整理匯總了PHP中Zend_Paginator::setDefaultPageRange方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Paginator::setDefaultPageRange方法的具體用法?PHP Zend_Paginator::setDefaultPageRange怎麽用?PHP Zend_Paginator::setDefaultPageRange使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend_Paginator
的用法示例。
在下文中一共展示了Zend_Paginator::setDefaultPageRange方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setCurrentPageNumber
public function setCurrentPageNumber($pageNumber)
{
$pageRange = 11;
switch ($pageNumber) {
case $pageNumber > 8 and $pageNumber < 100:
$pageRange = 7;
break;
case $pageNumber >= 100 and $pageNumber < 1000:
$pageRange = 5;
break;
case $pageNumber >= 1000:
$pageRange = 3;
break;
}
Zend_Paginator::setDefaultPageRange($pageRange);
return parent::setCurrentPageNumber($pageNumber);
}
示例2: testSetDefaultPageRange
/**
* @group ZF-9174
*/
public function testSetDefaultPageRange()
{
Zend_Paginator::setConfig(new Zend_Config(array()));
$paginator = Zend_Paginator::factory(range(1, 10));
$this->assertEquals(10, $paginator->getPageRange());
Zend_Paginator::setDefaultPageRange(20);
$this->assertEquals(20, Zend_Paginator::getDefaultPageRange());
$paginator = Zend_Paginator::factory(range(1, 10));
$this->assertEquals(20, $paginator->getPageRange());
$this->_restorePaginatorDefaults();
}
示例3: _initPagination
protected function _initPagination()
{
Zend_Paginator::setDefaultScrollingStyle('Sliding');
Zend_Paginator::setDefaultPageRange(5);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('paginator/paginationControl.phtml');
}