本文整理汇总了PHP中pager::pages方法的典型用法代码示例。如果您正苦于以下问题:PHP pager::pages方法的具体用法?PHP pager::pages怎么用?PHP pager::pages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pager
的用法示例。
在下文中一共展示了pager::pages方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: set
function set($entries, $page, $limit)
{
self::$entries = $entries;
self::$limit = $limit;
self::$pages = $entries > 0 ? ceil($entries / $limit) : 0;
self::$page = self::sanitize($page, self::$pages);
}
示例2: init
function init($pages, $cur_page, $uri)
{
self::$pager = true;
self::$pages = $pages;
self::$cur_page = $cur_page;
self::$pager_uri = $uri;
}
示例3: test_twelth_of_twelve_pages
public function test_twelth_of_twelve_pages()
{
$first = new pager(100, 1200, 12);
$actual = $first->pages();
$expected = array(1, 'skip', 6, 7, 8, 9, 10, 11, 12);
$this->assertEquals($expected, $actual);
}
示例4: render_paging_bar
protected function render_paging_bar(paging_bar $pagingbar)
{
$pagingbar = clone $pagingbar;
$pagingbar->prepare($this, $this->page, $this->target);
$show_pagingbar = $pagingbar->perpage > 0 && $pagingbar->totalcount > $pagingbar->perpage;
if (!$show_pagingbar) {
return '';
}
$current_page = $pagingbar->page + 1;
// Counting from one, not zero.
$pager = new pager($pagingbar->perpage, $pagingbar->totalcount, $current_page);
$pages = $pager->pages();
$pagination = new bootstrap_pager(html_entity_decode($pagingbar->baseurl), $current_page, $pager->last_page);
return bootstrap::pagination($pagination->for_pages($pages));
}