本文整理匯總了PHP中pagination::simple_pagination_links方法的典型用法代碼示例。如果您正苦於以下問題:PHP pagination::simple_pagination_links方法的具體用法?PHP pagination::simple_pagination_links怎麽用?PHP pagination::simple_pagination_links使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pagination
的用法示例。
在下文中一共展示了pagination::simple_pagination_links方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: pagination
function generate_pagination_links($totalpages, $totalrecords, $pagenumber, $pagesize)
{
$script = "";
$firstbound = 0;
$lastbound = 0;
$tooltip = "";
$lst = new pagination();
if ($this->paginationstyle == 1) {
$arr = $lst->advance_pagination_links($totalpages, $pagenumber);
} else {
$arr = $lst->simple_pagination_links($totalpages, 15, $pagenumber);
}
if (count($arr) > 0) {
foreach ($arr as $item) {
$firstbound = ($item - 1) * $pagesize + 1;
$lastbound = $firstbound + $pagesize - 1;
if ($lastbound > $totalrecords) {
$lastbound = $totalrecords;
}
$tooltip = "showing " . $firstbound . " - " . $lastbound . " records of " . $totalrecords . " records";
$css = "";
if ($item == $pagenumber) {
$css = " class=\"active\"";
}
$script .= "<li" . $css . "><a id=\"pg_" . $item . "\" href=\"" . $this->prepareUrl($item) . "\" class=\"pagination-css\" data-toggle=\"tooltip\" title=\"" . $tooltip . "\">" . $item . "</a></li>\n";
}
}
return $script;
}