本文整理匯總了PHP中Paging::sNavigationFloat方法的典型用法代碼示例。如果您正苦於以下問題:PHP Paging::sNavigationFloat方法的具體用法?PHP Paging::sNavigationFloat怎麽用?PHP Paging::sNavigationFloat使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Paging
的用法示例。
在下文中一共展示了Paging::sNavigationFloat方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: page
public function page($sQuery, $iPage)
{
$oPaging = new Paging("yase.php?account=" . $this->sAccount . "&query=" . $sQuery);
$sQuery = utf8_decode($sQuery);
$iTotal = $this->oSearcher->iSearch($sQuery);
if (!isset($_REQUEST['page']) || $_GET['page'] < 1) {
$iPage = 1;
}
$aRes = $this->oSearcher->aSearch($sQuery, $iPage);
$iPages = (int) (($iTotal - 1) / $this->oSearcher->iLimit) + 1;
print '<div class="summary_info">The search for <b>' . $sQuery . '</b> returned <b>' . $iTotal . '</b> results </div>';
print '<div class="navigation">';
$oPaging->sNavigationFloat($iPage, $iPages, 'account=' . $this->sName . '&query=' . $sQuery, $this->oSearcher->iLimit);
print '</div>';
foreach ($aRes as $oRes) {
print '<div class="title"><a href="' . $oRes->sUrl . '" target="_parent">' . $oRes->sTitle . '</a></div>';
print '<div class="content">' . $oRes->sContent . '</div>';
}
print '<div class="navigation">';
$oPaging->sNavigationFloat($iPage, $iPages, '&query=' . $sQuery, $this->oSearcher->iLimit);
print '</div>';
}