本文整理汇总了PHP中Gdn_Url::QueryString方法的典型用法代码示例。如果您正苦于以下问题:PHP Gdn_Url::QueryString方法的具体用法?PHP Gdn_Url::QueryString怎么用?PHP Gdn_Url::QueryString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gdn_Url
的用法示例。
在下文中一共展示了Gdn_Url::QueryString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: BuildPager
private function BuildPager($Sender, $Total)
{
$Sanitized = $this->ValidateInputs();
//get offset
$GETString = '?' . Gdn_Url::QueryString() . '&tar=srch';
//use this to providea link back to search - be sure to append the '&tar=srch' to tell to load the main search page
$GETString = str_replace('p=search&', 'search?', $GETString);
//echo $GETString; die;
$Limit = $this->Settings['Admin']->LimitResultsPage;
$Offset = ($Sanitized['Offset'] - 1) * $Limit;
//limit per page
$Pos = strpos($GETString, '&pg=' . $_GET['pg']);
if (!$Pos == FALSE) {
//$Url = substr($GETString, 0, $Pos); //strip the page number if it exists
$Url = str_replace('&pg=' . GetIncomingValue('pg'), '', $GETString);
//strip the page number if it exists
$Url = str_replace('&tar=srch', '', $Url);
//don't want to load adv search page when clicking page numbers
} else {
$Url = str_replace('&tar=srch', '', $GETString);
}
//don't want to load adv search page when clicking page numbers
$PagerFactory = new Gdn_PagerFactory();
$Sender->Pager = $PagerFactory->GetPager('Pager', $Sender);
$Sender->Pager->MoreCode = '>';
$Sender->Pager->LessCode = '<';
$Sender->Pager->ClientID = 'Pager';
$Sender->Pager->Configure($Offset, $Limit, $Total, $Url . '&pg=%1$s');
//echo $Url; die;
$Sender->SetData('GETString', $GETString);
}