本文整理汇总了PHP中pagination::urlFriendly方法的典型用法代码示例。如果您正苦于以下问题:PHP pagination::urlFriendly方法的具体用法?PHP pagination::urlFriendly怎么用?PHP pagination::urlFriendly使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pagination
的用法示例。
在下文中一共展示了pagination::urlFriendly方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: basename
$log->logError($e . " - " . basename(__FILE__));
}
echo "<div class=\"page-header\"><h1>" . _("Access Logs") . "</h1></div>";
echo "<h6>" . _("Options") . " : <a href=\"{$website}/" . ADMIN_DIRECTORY . "/settings#/misc\">" . _("Access Settings") . "</a></h6><br/>";
echo "<ul class=\"breadcrumb\">\n\t\t<li><a href=\"{$website}/" . ADMIN_DIRECTORY . "/settings\">" . _("Home") . "</a> <span class=\"divider\">/</span></li>\n\t\t<li class=\"active\">" . _("Access Logs") . "</li>\n\t\t</ul>";
if (!empty($number)) {
/*
initializing the ip2country class for converting ip address to country.
*/
$ip2country = new ip2country($db);
$p = new pagination();
$p->items($number);
$p->limit($max_show);
$p->currentPage($page);
$p->parameterName("p");
$p->urlFriendly();
$p->target("{$website}/" . ADMIN_DIRECTORY . "/access/%");
$from2 = $page * $max_show;
if ($from2 > $number) {
$diff = $number % $max_show;
$from2 = $number;
$from1 = $from2 - $diff;
} else {
$from1 = $from2 - $max_show;
}
echo "<table class=\"table table-condensed\">";
echo "<thead><tr>\n\t\t\t<th>" . _("ID") . "</th>\n\t\t\t<th>" . _("IP Address") . "</th>\n\t\t\t<th>" . _("Username") . "</th>\n\t\t\t<th>" . _("Country") . "</th>\n\t\t\t<th>" . _("Access") . "</th>\n\t\t\t</tr></thead>";
/*
loading all the tags data in arrays.
*/
while ($row = $q_do->fetch(PDO::FETCH_ASSOC)) {
示例2: create_paginator
function create_paginator($currentpage, $nb_items, $path)
{
require_once ROOT_DIR . '/' . INC_DIR . '/paginator-digg/pagination.php';
$p = new pagination();
$p->items($nb_items);
$p->currentPage($currentpage);
$p->limit(1);
$p->urlFriendly();
$p->target(URL . "/{$path}/page/%");
if ("" === $path) {
$p->target(URL . "/page/%");
}
$p->adjacents(1);
if (!$p->calculate) {
if ($p->calculate()) {
return "<div class=\"{$p->className}\">{$p->pagination}</div>";
}
}
}