本文整理匯總了PHP中vRequest::getGET方法的典型用法代碼示例。如果您正苦於以下問題:PHP vRequest::getGET方法的具體用法?PHP vRequest::getGET怎麽用?PHP vRequest::getGET使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vRequest
的用法示例。
在下文中一共展示了vRequest::getGET方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getLimitBox
function getLimitBox($sequence = 0)
{
$app = JFactory::getApplication();
// Initialize variables
$limits = array();
$selected = $this->limit;
// Build the select list
if ($app->isAdmin()) {
if (empty($sequence)) {
$sequence = VmConfig::get('pagseq', 0);
}
if (!empty($sequence)) {
$sequenceArray = explode(',', $sequence);
if (count($sequenceArray > 1)) {
foreach ($sequenceArray as $items) {
$limits[$items] = JHtml::_('select.option', $items);
}
}
}
if (empty($limits)) {
$limits[15] = JHtml::_('select.option', 15);
$limits[30] = JHtml::_('select.option', 30);
$limits[50] = JHtml::_('select.option', 50);
$limits[100] = JHtml::_('select.option', 100);
$limits[200] = JHtml::_('select.option', 200);
$limits[400] = JHtml::_('select.option', 400);
}
if (!array_key_exists($this->limit, $limits)) {
$limits[$this->limit] = JHtml::_('select.option', $this->limit);
ksort($limits);
}
$namespace = 'Joomla.';
$html = JHtml::_('select.genericlist', $limits, 'limit', 'class="inputbox" size="1" onchange="' . $namespace . 'submitform();"', 'value', 'text', $selected);
} else {
$getArray = vRequest::getGET();
$link = '';
unset($getArray['limit']);
// foreach ($getArray as $key => $value ) $link .= '&'.$key.'='.$value;
foreach ($getArray as $key => $value) {
if (is_array($value)) {
foreach ($value as $k => $v) {
$link .= '&' . $key . '[' . $k . ']' . '=' . $v;
}
} else {
$link .= '&' . $key . '=' . $value;
}
}
$link = 'index.php?' . ltrim($link, '&');
if (empty($sequence)) {
$sequence = VmConfig::get('pagseq_' . $this->_perRow);
}
if (!empty($sequence)) {
$sequenceArray = explode(',', $sequence);
if (count($sequenceArray > 1)) {
foreach ($sequenceArray as $items) {
$limits[$items] = JHtml::_('select.option', JRoute::_($link . '&limit=' . $items, false), $items);
}
}
}
if (empty($limits) or !is_array($limits)) {
if ($this->_perRow === 1) {
$this->_perRow = 5;
}
$limits[$this->_perRow * 5] = JHtml::_('select.option', JRoute::_($link . '&limit=' . $this->_perRow * 5, false), $this->_perRow * 5);
$limits[$this->_perRow * 10] = JHtml::_('select.option', JRoute::_($link . '&limit=' . $this->_perRow * 10, false), $this->_perRow * 10);
$limits[$this->_perRow * 20] = JHtml::_('select.option', JRoute::_($link . '&limit=' . $this->_perRow * 20, false), $this->_perRow * 20);
$limits[$this->_perRow * 50] = JHtml::_('select.option', JRoute::_($link . '&limit=' . $this->_perRow * 50, false), $this->_perRow * 50);
}
if (!array_key_exists($this->limit, $limits)) {
$limits[$this->limit] = JHtml::_('select.option', JRoute::_($link . '&limit=' . $this->limit, false), $this->limit);
ksort($limits);
}
$selected = JRoute::_($link . '&limit=' . $selected, false);
$js = 'onchange="window.top.location.href=this.options[this.selectedIndex].value"';
$html = JHtml::_('select.genericlist', $limits, '', 'class="inputbox" size="1" ' . $js, 'value', 'text', $selected);
}
return $html;
}